Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (2 votes)
4K views

Python University Question Paper

This document is a past paper for a Python programming exam with 5 questions. It contains instructions for candidates and asks students to complete tasks like writing Python code to check if a number is perfect, demonstrate list slicing, explain modules and packages, write recursive functions, and predict output of code samples. The summary provides an overview of the types of questions asked in the exam without copying significant content.

Uploaded by

sanika Gandhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
4K views

Python University Question Paper

This document is a past paper for a Python programming exam with 5 questions. It contains instructions for candidates and asks students to complete tasks like writing Python code to check if a number is perfect, demonstrate list slicing, explain modules and packages, write recursive functions, and predict output of code samples. The summary provides an overview of the types of questions asked in the exam without copying significant content.

Uploaded by

sanika Gandhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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