Question Bank
Question Bank
>25000 50%
<5000 No Discount
Prepare an algorithm to take the total bill value as input and calculate the discount amount and
discounted total bill value. Draw the flowchart for the same.
2. Write a Python program to verify whether the given number is an Armstrong number or Not. For
example ‘Armstrong number is’: 1^3 + 5^3 + 3^3 equal to 153. : 2^4 + 0^4 + 2^4 + 4^4 not
3. Write a Python program using functions to find the value of nPr and nCr.
b) Write a Python program to find the minimum length of the given three strings without using
inbuilt functions.
6. Evaluate the following expressions based on the precedence and associativity of the
operators. ((10 + 2) * 3 // 5) | (6 ^ 3) & (~(3 << 5)) or not True
7. Write a python program to find the Greatest Common Divisor (GCD). For example GCD of (42,
27) = 3
8. Demonstrate the use of all the iterative statements in Python to do sine series computation:
Sin(x) = x - x3/3! + x5/5! - x7/7! + x9/9! …
9. Write a Python code to calculate the tax for the given salary.
New Income Tax Slabs for Individuals in FY 2024-25
Income Tax Rate under new regime
Net Income
Up to Rs.3 lakhs Nil
Rs.3 lakh to Rs.7 lakh 5% of the total income that is more than Rs.3 lakh
Rs.7 lakh to Rs.10 lakh 10% of the total income that is more than Rs.7 lakh + Rs.15,000
Rs.10 lakh to Rs.12 lakh 15% of the total income that is more than Rs.10 lakh + Rs.45,000
Rs.12 lakh to Rs.15 lakh 20% of the total income that is more than Rs.12 lakh + Rs.90,000
Above Rs.15 lakh 30% of the total income that is more than Rs.15 lakh + Rs.1,50,000
10. Write Python program to convert one base into any base (Binary, Decimal, Octal, Hexa)
11. Differentiate between List, Tuple & Set with suitable examples of each. Explain any three
13. Write Pythonic code to multiply two matrices using nested loops.
14. Write a Python program for the following scenario: Let the first three numbers of the series be
15. Write a Python program to calculate the smallest common divisor (except 1) of given two
16. Write the algorithm, pseudocode and draw the flowchart for the following:
a. Tower of Hanoi
b. Sudoku (Sum of diagonals, sum of rows, sum of columns should be 15 / Numbers from 1
c. Age calculator
d. N queen problem
18. Create a Python program to remove the nth index character from a nonempty string.
19. Create a Python program to count the occurrences of each word in each sentence.
20. Analyse the given code. Write and justify the output:
a=20
b=20
print(a&b)
print(a|b)
print(a^b)
print(~a)
21. Write a program to display the pattern given as follows
* * * * * * 1
* * * * * * 1 2
* * * * * * 1 2 3
* * * * * * 1 2 3 4
* * * * * * 1 2 3
1 2
1
22. Create a class with following criteria:
Method: display ()
23. Write a Python Program to check if three points (x1, y1), (x2, y2), (x3, y3) are collinear.
24. What is a module and package in Python? Explain how can you access a module written in
Python. Give an example of package creation in Python.
25. Elucidate the below function in Python List with an example.
a) del
b) remove
c) sort
d) insert
e) pop
f) slicing
26. Write a Python program to find the length of the longest word in a given sentence..
27. Write a python programming to calculate the total bill value including GST (CGST & SGST
-12%).
1 Kukure 120
2 Brittania Cake 60
3 Oreao-Chocolate Biscuits 40
4 Lassi 35
28. Explain exception handling in python write a python program that demonstrate the use of try,
29. Write a python program to check the validity of passwords input by users
30. You are tasked with creating a Python class Book that represents a book in a library system.
The class should include the following: