0% found this document useful (0 votes)
7 views4 pages

Dhruti Mehta Python Exp 3

The document outlines an experiment for students in the UG Program in Electronics and Computer Science at Shah & Anchor Kutchhi Engineering College, focusing on the study of tuples and dictionaries in Python. Students are tasked with creating lists of names, ages, and salaries, generating tuples from these lists, and understanding the characteristics of tuples and dictionaries. The document also includes a brief explanation of tuples and dictionaries, along with an example of a dictionary.

Uploaded by

cikema9969
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)
7 views4 pages

Dhruti Mehta Python Exp 3

The document outlines an experiment for students in the UG Program in Electronics and Computer Science at Shah & Anchor Kutchhi Engineering College, focusing on the study of tuples and dictionaries in Python. Students are tasked with creating lists of names, ages, and salaries, generating tuples from these lists, and understanding the characteristics of tuples and dictionaries. The document also includes a brief explanation of tuples and dictionaries, along with an example of a dictionary.

Uploaded by

cikema9969
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
You are on page 1/ 4

Mahavir Education Trust's

SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE


Chembur, Mumbai - 400 088
UG Program in Electronics and Computer Science
Academic Year: 2024-2025

Experiment No: 03

Aim: Study of tuple and dictionaries in python

Problem Statement:

1. Create three lists- a lists of names, a list of age, a list of salaries.


2. Generate and print a list of tuples containing name, age and salaries from
3 lists.
3. From this list generate 3 tuples one contains all age, one contains all
names, one contains all the salaries.

Theory:
Tuple is the collection of the object much like the lists. The sequence is s of value stored in the
tuple can be any type, and they are indexed by integers. Value of tuple are syntactically separated
by ‘commas. Although it is not necessary, it is more effective way to define tuple. Sequence of
the parenthesis. This help tuple to understand more easily. It is defined within parentheses ()
where items are separated by commas. >>> t = (5,'program', 1+3j) We can use the slicing
operator [] to extract items but we cannot change its Value.
Dictionaries: Dictionaries are used to store data values in key:value pairs. A dictionary is a
collection which is ordered*, changeable and does not allow duplicates.

Example:

thisdict={ "Food_category

": "fruit", "seasonal":

"Mango",

"month": "April"
}
print(thisdict["Food_category"])

Program:
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Program in Electronics and Computer Science
Academic Year: 2024-2025

1:

2:

3:
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Program in Electronics and Computer Science
Academic Year: 2024-2025

Out Put:

3:
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Program in Electronics and Computer Science
Academic Year: 2024-2025

You might also like