Python Mocker
Python Mocker
3 Hours / 70 Marks
Instructions –
(1) Attempt all questions.
(4) Those who are still not joined to Diploma Helper group feel free to contact us at 8698079745.
(5) Tomorrow morning make sure to write this paper again from notes , textbook etc properly again
and analyse what you had done wrong .
c) Write a program to calculate the sum of digit of given number using function.
a) Write a python program to input any two tuple & interchange the tuple variable.
c) Write a program to create user define module that will ask the program name and
display the name of program.
a) Write a program to create 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
e) Write a program to open a file in write mode and append some contents at end of file.
c) Write a Python program to create a class ‘Diploma’ having a method ‘getdiploma’ that
prints “I got a diploma”. It has two subclasses namely ‘CO’ and ‘IF’ each having a method
with the same name that prints “I am with CO diploma” and ‘I am with IF diploma’
respectively. Call the method by creating an object of each of the three classes.
b) Write a program to create a user defined exception that will check whether password is
correct or not .