22plc151 QB Module 1 Updated
22plc151 QB Module 1 Updated
(AccreditedbyNBA2022-2025)
Question Bank
Semester: I
Course Name & Code: Python Programming(22PCL151)
Module1
Python Basics, Flow Control
1) List the data types used in Python. Explain each with examples.
2) Explain the following functions in Python with suitable examples. print(), input(), len()
3) Explain the built-in functions which can be used to get the integer, floating-point number or string
version of a value. Give example for each function.
4) List and explain comparison operators used in Python with suitable examples.
5) List and explain math operators used in Python with suitable examples.
6) Explain with an example, how + and * operators work with strings.
7) Explain the basics for executing a python program using REPL (shell) with an example. Write a
python program to read using REPL (shell) and display the output.
8) Explain about different Boolean operators in python with appropriate examples.
9) List the rules for naming available in Python. Identify the following variables as valid and invalid.
Balance, current balance, current-balance, 4account, _spam, 42, current Balance, current balance,
SPAM, total_$um, 'hello', account4
10) Which of the following are operators, and which are values?
* 'hello' -88.8 +
/ - 5 //
11) What does the variable bacon contain after the following code runs?
a) bacon=20
b) bacon++
12) What should the following two expressions evaluate to?
a) 'spam'+'spamspam' b) 'spam'* 3
28) Write a Python program to input a number and count the number of digits in it using while loop.
29) Write for loop to generate the following series.
a) 1234……50
c) 999795 93……1
Prepared by Faculty, Python Programming, GAT Page|2
d) -10-9-8-7 10
e) 12 4 8 16 32
f) 10 -10 20 -20 30 -30…….. 60-60
30) Write for loop to find the sum of the following series