Printed Pages: Roll No.
SUBJECT CODE:
PUT SESSIONAL EVEN SEMESTER EXAMINATION – JULY(2024)
PROGRAM NAME- [Link]
YEAR/SEMESTER-
COURSE/SUBJECT NAME: PYTHON
[Time: 3 Hours] [Maximum Marks: 70]
INSTRUCTIONS:
(i) There are THREE sections in this question paper.
(ii) Attempt questions from each section as per the directions.
(iii) Make suitable assumptions wherever necessary.
SECTION-A (Very Short Answer Type Questions)
Q.1. Attempt ALL questions. (7×2=14)
(a) What is PIP?
(b) Define floor division.
(c) What is a dictionary in Python?
(d) Explain the programming cycle for Python in detail.
(e) Write a loop that prints numbers from 0 to 57 , using range function.
(f) Explain the role of precedence with an example.
(g) Define fruitful functions and void functions.
(h) What is the difference between list and tuples in python?
SEC-B
Q 2. (7×3=21)
(a)
Write and explain an algorithm through Python code to generate prime numbers.
(b) Find stepwise solution of following expressions if a=3,b=5,c=10.
b>>a**2>>b**2^c**3
(c) Write a Python program to check if the input year is a leap year or not.
(d) What is short circuit evaluation? What is printed by the following python
program?
A=0 , b=2 , c=3 , x=c or a
Print (x)
SEC-C
Q 3. Attempt any one question (7×1=7)
(a) Discuss various categories of operators in python. Find & explain
stepwise solution of following expressions if a=3,b=5,c=10.
a & b <2/5 **2 + c^b
Page 1 of 2
(b) Write python program to swap two numbers without using
intermediate/temporary variables. Prompt user for input.
Q 4. Attempt any one question (7×1=7)
(a) Compare list and dictionary data structure. Explain various dictionary methods
with suitable example of each.
(b) Discuss list data structure of Python. Explain various inbuilt methods of list.
Q 5. Attempt any one question (7×1=7)
(a) Discuss the different types of argument-passing methods in python.
(b) What is the significance of module in python? What are the methods of importing
a module? Explain with example.
Q 6. Attempt any one question (7×1=7)
(a) Write a program that accepts a sentence & calculate the number of digits,
uppercase and lowercase letters.
(b) Write a python program to add an item in a tuple.
Q 7. Attempt any one question (7×1=7)
(a) How to create and import a module in python?
(b) What is shot circuit evaluation? What is printed by the following python program?
a=0
b=2
c=3
x=c or a
print (x)
Page 2 of 2