Preliminary Examination Paper
Preliminary Examination Paper
Thergaon,Pune
Preliminary Examination
Course Title: Programming with Python
……………………………………………………………………………………………………………………………………………………
…
Instructions:
c) Describe Dictionary
a) Explain two Membership and two logical operators in python with appropriate examples.
b) Describe any four methods of lists in Python
a) Write a program to input any two tuples and interchange the tuple variable.
b) Write a python program to read contents of first.txt file and write same content in second.txt
file
c) Show how try…except blocks is used for exception handling in Python with example
>>>fruit[:3]
>>>fruit[3:]
>>>fruit[3:3]
>>>fruit[:]
1. >>> a=[1,2,3]
>>>b=[4,5,6]
>>> c=a+b
2. >>>[1,2,3]*3
3. >>>t=[‘a’,’b’,’c’,’d’,’e’,’f’]
>>>t[1:3]=[‘x’,’y’]
>>>print t
c) Design a class Employee with data members: name, department and salary. Create suitable
BEST OF LUCK