Faculty of Technology and Engineering: U & P U. Patel Department of Computer Engineering
Faculty of Technology and Engineering: U & P U. Patel Department of Computer Engineering
Faculty of Technology and Engineering: U & P U. Patel Department of Computer Engineering
Practical List
Academic Year : 2021-22 Semester : 4
Course code : CE259 Course name : Programming in Python
Note: Practical List is for Students. We need to cover concept require to implement respective
practical
Sr. Aim
No.
1. Installation & Configuration of Python(3.6 or 3.7) and Virtual Environment. Along with
its all major editors, IDLE, Pycharm, Anaconda, Jupyter, Interpreter etc.
Note: Do not install the latest version of python due to some backward
compatibility issues.
Please take screenshots of each point mentioned in the assignment and upload .pdf
file.
2. Dictionary
a. Write a Python script to check whether a given key already exists in a
dictionary.
b. Write a Python script to merge two Python dictionaries.
c. Write a Python program to sum all the items in a dictionary.
d. Write a Python script to add a key to a dictionary.
Sample Dictionary : {0: 10, 1: 20}
Expected Result : {0: 10, 1: 20, 2: 30}
e. Write a Python script to concatenate the following dictionaries to create a
new one.
Sample Dictionary :
dic1={1:10, 2:20}
dic2={3:30, 4:40}
dic3={5:50,6:60}
Expected Result : {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}
Tuple
a. Write a Python program to create a tuple with different data types.
b. Write a Python program to create a tuple with numbers and print one item.
c. Write a Python program to add an item in a tuple.
Page 1 of 5
<20CE158> <Pratham Patel>
d. Write a Python program to convert a tuple to a string.
e. Write a Python program to find the length of a tuple.
Set
a. Write a Python program to add member(s) in a set and clear a set
b. Write a Python program to remove an item from a set if it is present in the
set.
c. Write a Python program to create an intersection, Union, difference of sets.
d. Write a Python program to find maximum and the minimum value in a set.
4. Write a Python program to find the most common elements and their counts
from list, tuple, dictionary.
Code :
Page 3 of 5
<20CE158> <Pratham Patel>
Page 4 of 5
<20CE158> <Pratham Patel>
3.
4.
5.
6.
7.
8.
9.
10.
Page 5 of 5