Pythonquestionbank
Pythonquestionbank
Unit-2
1. Write short note on Boolean data type
2. List out the types of modules
3. Define class
4. Define Nested if statement.
5. What is methods?
6. Define Build-in modules
7. What are uses of user defind modules?
8. Define object oriented way.
9. Define Boolean expression Evalution
10.What is constructor?
11.Write a Python program to Find Sum of tuple elements
12.Differentiate while loop and for loop.
13. Write a python program to find area of a circle.
14. What is a pass in Python?
(Big Questions)
1. Write a python program to check if a year is leap year or
Not by using (Nested if)
2. Write a python program to find the maximum of three
numbers by using (Nested if)
3. Write a python program to remembering the results
Boolean Expression Evalution.
4. Write a python program calling methods the Object-
Oriented Way and Write any two examples
5. Write short note on modules.
i)Build-in modules.(math,date&time)
ii)User -defind modules(any 2 examples)
6.Explain details about constructor and write any two
examples.
7.Differentiate method and function.
8.Write a program to Check if a Number is Prime or not
9. Differentiate between List and Tuple?
10. An e-commerce company plans to give their customers a
discount
for the New Years holiday. The discount will be calculated on
the basis of the bill amount of the order placed. The discount
amount is the sum of all the odd digits ion the customer’s total
bill amount. If no odd digit is present in the bill amount, then
the discount will be zero.Write an algorithm to find the
discount for the given total bill amount.
Input
The input consists of an integer bill Amount, representing the
customer’s total bill amount.
Output
Print an integer representing the discount for the given total
bill
Amount
Input:
2514795
Output
27
Unit-3
1. What is looping ?Given Example.
2. Brief the advantages of list
3. What will be the output of the following python code?
i=1
while True:
if i%3 == 0:
break
print(i)
i+=1
4. What will be the ouput of the following python code
for i in range[1,2,3,4][::-1]:
print(i,end= “ ” )
5.Define Nested looping.
6.Write a Python program to Find Sum of tuple elements
7. What is a pass in Python?
8. Write a program to find the middle element in the
dictionary.
(Big Questions)
1. ).Given a list of Numbers analyze both of the searching
Linear and binary search.
2. Write a python program to sort a list of integers in
Ascending order using selection sort algorithm.
Input:
[11,9,5,6,1]
Output:
[1,5,6,9,11]
3. Write a python program to find the second largest and
Second smallest elements in the list
4.Write a python program to find sum of all elements in list.
5.Write a python Program to Swap Two Elements in a List.
Input : List = [23, 65, 19, 90], pos1 = 1, pos2 = 3
Output : [19, 65, 23, 90]
UNIT 5
(Big Questions)