0% found this document useful (0 votes)
8 views5 pages

Experiment 1 Python

The document outlines an experiment focused on working with various data types in Python, including strings, lists, tuples, sets, and dictionaries. It provides specific programming tasks such as storing and displaying company names, manipulating product lists, and managing employee details. The experiment is submitted by Akash Parida, a student in an MBA program.

Uploaded by

Akash Parida
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Experiment 1 Python

The document outlines an experiment focused on working with various data types in Python, including strings, lists, tuples, sets, and dictionaries. It provides specific programming tasks such as storing and displaying company names, manipulating product lists, and managing employee details. The experiment is submitted by Akash Parida, a student in an MBA program.

Uploaded by

Akash Parida
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EXPERIMENT- 3

Aim Of The Experiment:- Working with data types” string ,list ,


tuple set and dictionary”

a) Write a Python program to store a company name in a string and display it.

company_name = "Tata Consultancy Services"


print(company_name)

b) Write a Python program to find the length of a product name stored in a


string ?
Product_name = “Laptop”
Print(len(product_name))

c) Write a Python program to convert a department name into uppercase ?

Department = “human resources”


Print([Link]())
d) Write a Python program to create a list of products and display all
products ?

Products = [“Mobile”, “Laptop”, “Tablet”, “Headphones”]

For item in products:


Print(item)

e) Write a Python program to add a new product to the product list ?

Products = [“Mobile”, “Laptop”, “Tablet”]


[Link](“Smart Watch”)
Print(products)
f) Write a Python program to remove a product from the product list ?
Products = [“Mobile”, “Laptop”, “Tablet”]
[Link](“Laptop”)

Print(products)

g) Write a Python program to create a tuple of months and display any


one month ?

Months = (“January”, “February”, “March”, “April”)


Print(months[1])
h ) Write a Python program to create a set of employee IDs and display unique
IDs ?

Employee_ids = {101, 102, 103, 101, 104}


Print(employee_ids)

I ) Write a Python program to create a dictionary storing employee details


(ID and name ) ?

Employee = {
101: “Rahul”,
102: “Amit”,
103: “Priya”
}

Print(employee)
J ) Write a Python program to update the salary of an employee using a
dictionary ?
Salary = {
101: 30000,
102: 35000,
103: 40000
}

Salary[102] = 38000
Print(salary)

Submitted By : Akash Parida


Registration Number : 2504060004
MBA

You might also like