Professional Documents
Culture Documents
PWP 3
PWP 3
Scheme – I
Programme Name: Computer Science and Engineering
Subject Code: 22616
Semester: VI Sem
Course Title: Programming with Python
Marks : 70 Time: 3 Hrs.
……………………………………………………………………………………………………
Instructions:
(1) All questions are compulsory.
(2) Illustrate your answers with neat sketches wherever necessary.
(3) Figures to the right indicate full marks.
(4) Assume suitable data if necessary.
(5) Preferably, write the answers in sequential order.
a) With neat example differentiate between readline() and readlines() functions in file-handling.
b) Write the output for the following if the variable fruit=’banana’:
>>>fruit[:3
>>>fruit[3:]
>>>fruit[3:3]
>>>fruit[:]
c) Explain seek ( ) and tell ( ) function for file pointer manipulation in python with example.
d) Explain use of format () method with example.
e) 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
a) Write a program to create class EMPLOYEE with ID and NAME and display its contents
b) Write a program for importing module for addition and substraction of two numbers.
c) Describe Multiline comment in python. Enlist and explain applications for python
programming.
d) Explain membership and Identity operators in Python.
e) Write a Python program to calculate sum of digit of given number using function.