Python University Question Paper

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Total No. of Questions : 5] SEAT No.

PA-1029 [Total No. of Pages : 3


[5902]-57
T.Y. B.Sc. (Semester - V)
COMPUTER SCIENCE
CS-3510 : Python Programming
(2019 Pattern) (CBCS)

Time : 2 Hours] [Max. Marks : 35


Instructions to the candidates:
1) Figures to the right indicate full marks.
2) All Questions are compulsory.
3) Total number of questions are FIVE.

Q1) Attempt any Eight of the following (Out of Ten). [8 × 1 = 8]


a) What are the advantages of Python?
b) List out main differences between lists & tuple.
c) Python is a scripting language. Comment.
d) Demonstrate set with example.
e) What is dictionary? Give example.
f) What is regEx? give example.
g) What is user defined Module? Give example.
h) Python is case sensitive language. Comment.
i) What is dry run in Python?
j) What is lambda function? Give example.

Q2) Attempt any four of the following (Out of Five). [4 × 2 = 8]


a) Write a python program to calculate XY.
b) Write a python program to accept a number and check whether it is
perfect number or not.

P.T.O.
c) What is the use of seek( ) & tell ( ) functions?
d) Demonstrate list slicing.
e) A tuple is ordered collection of items. Comment.

Q3) Attempt any Two of the following (Out of Three). [2 × 4 = 8]


a) Write a short note on datatypes in Python.
b) Write a short note on exception handling.
c) What is a module? What is package? Explain with example.

Q4) Attempt any Two of the following (Out of Three). [2 × 4 = 8]


a) Write a recursive function in Python to display addition of digits in
single digit.
b) Write a program in python to accept 'n' integers in a list, compute &
display addition of all squares of these integers.
c) Write a Python program to count all occurences of "India" and
"Country" in a text file "pledge.txt".

Q5) Attempt any One of the following (Out of Two). [1 × 3 = 3]


a) What is the output of following code :
X=5
def f1( ) :
global X
X=4
def f2(a, b) :
global X
return a+b+X
f1( )
total = f2(1, 2)
print (total)
[5902]-57 2
b) What is the output of following code :
def f(X) :
def f1(a, b) :
print ("hello")
if (b==0) :
print ("NO")
return
return f(a, b)
return f1
@f
def f(a, b) :
return a%b
f(4, 0)



[5902]-57 3

You might also like