0% found this document useful (0 votes)
10 views5 pages

Question Bank

Uploaded by

japeb62547
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)
10 views5 pages

Question Bank

Uploaded by

japeb62547
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

Question Bank

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

Write a program to take the total bill value as input and calculate the discount amount and discounted

total bill value.

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.

c) Python program to counts how many times each word appears in the sentence.

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

b) String Operations and Methods

6. a) Different types of operators with examples.


b) Evaluate the following expressions based on the precedence and associativity of the
operators. ((10 + 2) * 3 // 5) | (6 ^ 3) & (~(3 << 5))
c) Write a python program to find the Greatest Common Divisor (GCD). For example GCD of
(42, 27) = 3
7. 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! …
8. 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

9. Write Python program to convert one base into any base (Binary, Decimal, Octal, Hexa)

10. Differentiate between List, Tuple & Set with suitable examples of each. Explain any three

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

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

12. Write Pythonic code to multiply two matrices using nested loops.

13. 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.

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

integers, non-zero, positive numbers.

15. Write python programming 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.

16. 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. Calculator

d. Age calculator

e. N queen problem

17. a) Create a Python program to remove the nth index character from a nonempty string.

b)Discuss control flow statements in Python with examples. Write a Python program to create a

vending machine that allows users to interact with a virtual machine where they can:

a. Insert money

b. Select items to purchase

c. Check their balance

d. Exit the machine

18. Create a Python program to count the occurrences of each word in each sentence.

19. Analyse the given code. Write and justify the output:

a=20

b=20
print(a&b)
print(a|b)
print(a^b)
print(~a)
20. 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
21. a) Create a class with following criteria:

Class name: flower

Properties: price, color

Method: display ()

Create objects: rose, sunflower

Call method to display object properties

b) Design a simple banking system using classes where you can create an account, deposit money,

withdraw money, and check the balance.

22. Write a Python Program to check if three points (x1, y1), (x2, y2), (x3, y3) are collinear.

23. 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.
24. Elucidate the below function in Python List with an example.
a) del
b) remove
c) sort
d) insert
e) pop
f) slicing
25. Write a Python program to find the length of the longest word in a given sentence.

26. Write a python programming to calculate the total bill value including GST (CGST & SGST -12%).

Product Value
S.No Product
120
Kukure
1
60
Brittania Cake
2

Oreao-Chocolate Biscuits 40
3
35
Lassi
4

27. Explain exception handling in python write a python program that demonstrate the use of try,

except, and finally blocks to handle division by zero.

28. 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

29. 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
30. Explain the concept of functions in Python

You might also like