PYQ – PYTHON PROGRAMMING (2418305) | SEMESTER 3RD (2ND YEAR) | Year 2022

Python Programming 2022 OLD PYA.
Choose the most suitable answer from the following options: - (1*20=20)
(i) Who developed python programming language?
(a) Wick Van Rossum
(b) Rasmus Lerdorf
(c) Guido Van Rossum
(d) Niene Stom
(ii) Is python case sensitive when dealing with identifiers?
(a) No
(b) Yes
(c) Machine dependent
(d) None of the mentioned
(iii) Is python code compiled or interpreted?
(a) Python code is both compiled and interpreted
(b) Python code is neither complied nor interpreted
(c) Python code is only compiled
(d) Python code is only interpreted
(iv) What will be the value of the following python expression: 4 + 3 %
5
(a) 7
(b) 2
(c) 4
(d) 1
(v) Which keyword is used for function in python language?
(a) Function
(b) Def
(c) Fun
(d) Define
(vi) What will be the output of the following python code?
i = 1
while True:
if i % 3 == 0:
break
print (i)
i+=1
(a) 1 2 3
(b) Error
(c) 1 2
(d) None
(vii) Python supports the creation of anonymous functions at runtime using
a construct called.
(a) pi
(b) anonymous
(c) Lambda
(d) None
(viii) What will the output of the following python code snippet if x =1?
x<<2
(a) 4
(b) 2
(c) 1
(d) 8
(ix) Which of the following is the truncation division operator in python?
(a) |
(b) //
(c) /
(d) %
(x) Which of the following function is a build-in function in python?
(a) factorial ()
(b) print ()
(c) seed ()
(d) sqrt ()
(xi) Which of the following is not a core data type in python programming?
(a) Tuples
(b) Lists
(c) Class
(d) Dictionary
(xii) What will be the output of the following python code
x = ‘abcd’
for I in x:
print(i.upper())
(a) aBCD
(b) abcd
(c) Error
(d) ABCD
(xiii) What will be the output of the following python code?
for i in [1,2,3,4] [::-1]
print (i)
(a) 4 3 2 1
(b) Error
(c) 1 2 3 4
(d) None
(xiv) What function is called when the following python program is executed?
f = foo()
format(f)
(a) str ()
(b) format ()
(c) __str__ ()
(d) __format__ ()
(xv) What arithmetic operators cannot be used with strings in python?
(a) *
(b) -
(c) +
(d) All of the mentioned
(xvi) Which of the following statements is used to create an empty set in
python?
(a) ()
(b) []
(c) {}
(d) set ()
(xvii) Which of the following python statement will result in the output: 6?
A [[1,2,3] [4,5,6] [7,8,9]]
(a) A [2][1]
(b) A [1][2]
(c) A [3][2]
(d) A [2][3]
(xviii) Which of the following is a python tuple?
(a) {1,2,3}
(b) {}
(c) [1,2,3]
(d) (1,2,3)
(xix) What will be the output of the following python expression?
round (4.576)
(a) 4
(b) 4.6
(c) 5
(d) 4.5
(xx) What is the maximum possible length of an identifier?
(a) 16
(b) 32
(c) 64
(d) None
Group:-"B"
➥ Answer all Five Questions: - (5*4=20)
2. Discuss python and its benefits.
OR
Explain print () and input () function in python.
3. Differentiate between .py and .pyc files.
OR
Discuss split () and join () function in python.
4. Discuss the key features of python.
OR
Define list with the help of example.
5. Define tuple with the help of example.
OR
Explain dictionary using python code.
6. Differentiate between python array and list.
OR
Discuss write function in python.
Group:- "C"
➥ Answer all Five Questions: - (5*6=30)
7. Discuss continue and break with the help of python program.
OR
Explain python variables and numeric data in detail.
8. Write a program in python to check whether string is palindrome or not.
OR
Discuss complete installation process of python in detail.
9. Write a python program to calculate the area and perimeter of circle using python.
OR
Discuss append (), extend () and insert () function of python.
10. Write a python program to get the Fibonacci series between 0 to 55.
OR
Define if, else and elif in python using program.
11. Write notes on following.
Django
Web2py
OR
Write notes on following
Module
Package
*****
PYQ Video References
No references available right now.
Comments & Reviews
Loading comments...
