Python Programming (1BPLC105B) Question Bank – Module 1
MODULE-1
Python Basics, Flow Control and Functions
Q. No. Questions COs CL Marks
1 What is the need for role precedence? Illustrate rules precedence
CO1 L2 6M
in Python with Example. (Jan/Feb 2023)
2 Explain the salient features of Python Programming Language.
CO1 L2 6M
(July / August 2022)
3 Define a program. List and explain the structure of a program with
CO1 L2 6M
an example.
4 Explain debugging in Python. Differentiate between syntax error,
CO1 L2 8M
runtime error, and semantic error.
5 List and explain the syntax of all Flow Control Statements with an
example. (July / August 2022) CO1 L2 8M
With the flow chart, explain the flow control statements while, for and
elif. Write a python program to check whether the given number is
positive or negative or zero. (July / August 2021)
Explain elif, for, while break and continue statements in python with CO1 L2 10M
examples for each. (Jan / Feb 2021) (June/July 2024)
6 Write a python program to calculate the area of circle, rectangle and
triangle. Print the results. (Jan/Feb 2023) (July / August 2022) CO1 L2 6M
7 What is a Function? How to define a function in Python? Explain with
suitable examples. (July / August 2022)
What are functions? Define python function with parameter and return
statement. Write a python function to generate the factorial CO1 L2 7M
of a number. (Jan/Feb 2023) (July / August 2021) (June/July 2024).
Write a function to calculate factorial of a number. Develop a program
to compute binomial coefficient (Given N and R).
8 Explain local scope and global scope with suitable example.
(Jan/Feb 2023) (July / August 2022) (July / August 2021) CO1 L2 5M
(June/July 2024)
Python Programming (1BPLC105B) Question Bank – Module 1
9 What is an arithmetic expression? What is the output of this CO1 L3 6M
statement? ‘hello world’ + 100 + ’how are you’ explain the
reason if the statement produces an error. (2022-23)
10 Write a Python program to calculate the area of rectangle and CO1 L2 6M
triangle and print the results.
(Jan / February 2023)
12 Illustrate the use of break and continue with an example. CO1 L2 5M
(July / August 2021)
13 Demonstrate the use of break and continue keywords using a CO1 L2 6M
code snippet.
(Feb / March 2022)
14 List and define the use of comparison operators in Python. Write CO1 L1 6M
the output for the following expression in Python:
i) 2.3 ii) 20% 6 iii) 20/6 (Feb / March 2022)
15 What is user defined function? Write a function to check if a CO1 L2 7M
given number is a prime or not.
(Feb / March 2022)
What is user defined function? How can we pass parameters in
user defined functions? Explain with suitable example.
(Model QP)
16 Demonstrate with an example print(), input(). (Jan / Feb 2021) CO1 L2 4M
17 Write a python program to check whether a given number is CO1 L2 4M
even or odd.
(Jan / Feb 2021)
18 Explain the math operators in python from highest to lowest CO1 L2 8M
precedence with an example for each. Write the steps how
python is evaluating the expression (5-1) * ((7+1)/(3-1)) and
reduces it to a single value.
(Model QP)
19 Define a python function with suitable parameters to generate CO1 L2 8M
prime numbers between two integer values. Write a python
program which accepts two integer values m and n (note M.0
and n>0) as inputs and pass the values to the function. Suitable
error messages should be displayed if the conditions for input
values are not
followed. (Model QP)
Python Programming (1BPLC105B) Question Bank – Module 1
20 What are comparison and Boolean operators? List all the CO1 L2 6M
comparison and Boolean operators in python and explain the
use of these operators with suitable examples.
(Model QP)
21 Define a python function with suitable parameters to generate CO1 L2 8M
first N Fibonacci numbers. The first two Fibonacci numbers are 0
and 1 and the Fibonacci sequence is defined as a function F as
𝐹𝑛 = 𝐹𝑛−1 + 𝐹𝑛−2.
Write a python program which accepts a value for N (where N
>0) as input and pass this value to the function. Display suitable
error message if the condition for input value is not followed.
(Model QP)
22 Write a python program to the Collatz 3n + 1 sequence. CO1 L2 6M
23 Write a function that computes and returns addition, CO1 L2 6M
subtraction, multiplication and division of two integers. Take
input from user. (Model QP)
24 Give the outputs of the following expressions. CO 1 L2 4M
55//15
-17//10
-16%5
17%-10
5*1**3
(200-70)*10/5
25 Write a single user defined function named ‘Solve’ that returns CO 1 L2 6M
the Remainder and Quotient on division of two numbers
accepted from the user. Print the Remainder and Quotient
separately on the console.
26 Write a python program to check whether the given year is leap CO 1 L2 4M
or not.
27 Write a python program to check whether the given number is CO 1 L2 6M
positive or negative or zero.
Develop a program to read the student details like Name, USN
and Marks in 3 subjects. Display the student details, total marks
and percentage with suitable examples. (June/July 2024)
Python Programming (1BPLC105B) Question Bank – Module 1
28 Write a python program to read 2 numbers from the keyboard CO 1 L2 6M
and perform the basic arithmetic operations based on the
choice. (1-Add, 2-Subtract, 3-Multiply, 4-Divide).
29 Write a program to read the name and year of birth of a person. CO 1 L2 6M
Display whether the person is a senior citizen or not.
30 Define Fruitful function. CO 1 L2 8M
Write a fruitful function sum_to(n) that returns the sum of all
integer numbers up to and including n. So sum_to(10) would be
1+2+3...+10 which would return the value 55.
Faculty