0% found this document useful (0 votes)
18 views

Question Bank

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Question Bank

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1. The XYZ is a shop that sells clothes at different discounted prices as below.

Total Bill Value Discount

>25000 50%

Between 20000 and 25000 40%

Between 15000 and 20000 30%

Between 10000 and 15000 20%

Between 5000 and 10000 10%

<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

equal to 2024. It is not an ‘Armstrong number’.

3. Write a Python program using functions to find the value of nPr and nCr.

4. a)Python program to check whether the string is Symmetrical or Palindrome.

b) Write a Python program to find the minimum length of the given three strings without using

inbuilt functions.

5. a)Write a Python program to Check if two strings are anagrams.

b) String Operations and methods

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

collection data types of python with a suitable example of each.

12. Create two different lists and make it as one table.

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

0, 1, 1, 2, 3... Write a code to generate the 100th number of this series.

15. Write a Python program to calculate the smallest common divisor (except 1) of given two

integers, non-zero, positive numbers.

16. Write the algorithm, pseudocode and draw the flowchart for the following:

a. To find the sum of the square root of any three numbers.

b. To find the factorial of number n.

c. To find the first n numbers in a Fibonacci series.

d. To find whether a number is prime or not using Charles Babbage function.

e. To convert temperature from Fahrenheit to Celsius

f. To solve the quadratic equation.

17. Write a python code for

a. Tower of Hanoi
b. Sudoku (Sum of diagonals, sum of rows, sum of columns should be 15 / Numbers from 1

to 9 and no should not be repeated. Hint: consider 3x3 matrix)

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:

Class name: flower

Properties: price, color

Method: display ()

Create objects: rose, sunflower

Call method to display object properties

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%).

S.No Product Product Value

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,

except, and finally blocks to handle division by zero.

29. Write a python program to check the validity of passwords input by users

a. At least 1 letter between [a-z] and one letter between [A-Z]

b. At least one number between [0-9]

c. At least one character from [$#@]


d. Minimum length 6 characters

e. Maximum length 16 characters

30. You are tasked with creating a Python class Book that represents a book in a library system.
The class should include the following:

Public Attribute: title

Protected Attribute: author

Private Attribute: isbn

Protected Method: update author details


Private Method: get isbn number

You might also like