JSPM’s
Bhivrabai Sawant Polytechnic,
Wagholi, Pune- 412207.
(Academic Year 2024-25)
Assignment - 3
Sub: - Programming With Python(PWP) Subject Code:22616
Semester: 06 Chapter : 3
Unit 3. Data Structures in Python
( 14 MARKS)
✦ Attempt the Following (2 Marks) :-
1. Explain two ways to add objects / elements to a list ?
2. Describe Tuples in Python. ?
3. Compare list and tuple.?
4. Write down the output of the following Python code.
indices=['zero','one','two',' three','four', 'five']
i) indices[:4]
ii) indices[:-2]
5. Explain any two built in methods of set in python with example
✦ Attempt the Following (4 Marks) :-
1. Explain four built-in list functions.?
2. T = ('spam, Spam', SPAM!', 'SaPm')
print (T [2])
print (T[-2])
print (T[2:])
print (List (T))
3. Explain four Built-in tuple functions in python with example. ?
4. Write a program to create a dictionary of students that includes their ROLL NO and NAME ?
i) Add three students in above dictionary
ii) Update name=’Shreyas’ of ROLL NO=2
iii) Delete information of ROLL NO=1
5. Write any four methods of the dictionary.?
✦ Attempt the Following (6 Marks) :-
1. Write python program to perform following operations on Set (Instead of Tuple)
i) Create set
ii) Access set Element
iii) Update set
iv) Delete set
2. Write a Python Program to accept values from user in a list and find the largest number and
smallest number in a list.