Class Xi - Python Practical File Programs 2021-2022 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

INFORMATICS PRACTICES

INDEX OF PYTHON PROGRAMS


CLASS XI
2021-2022

SELECTIVE CONTROL STATEMENT – IF-ELSE OR IF-ELIF


1. WAP to accept two numbers and check for their divisibility.
2. WAP to accept two numbers and a mathematical operator and carry out the calculation as
per the given operator.
3. WAP to accept the firstname, lastname and gender of a user and display the following message
“Hello, Mr./Ms Firstname Lastname Welcome!! Hope You like this program”
4. WAP to accept marks of a student in 5 subjects and calculate the total marks, percentage, grade
and result of the student. The grade is assigned as per the following scheme:
GRADING SCALE
GRADE UPPER LIMIT LOWER LIMIT
A1 100.00 90.00
A2 89.99 80.00
B1 79.99 70.00
B2 69.99 60.00
C1 59.99 50.00
C2 49.99 40.00
D 39.99 33.00
E 32.99 0.00
The result is displayed as “PASS” %age is more than 33% and “FAIL” otherwise.
5. WAP to provide the user choice of finding area of closed figures (square, rectangle, circle,
triangle). Display a menu to the user for accepting input for the choice of the figure and take
input, calculate and display area of the figure chosen by the user accordingly.
6. WAP to accept the customer type and bill amount and calculate the discount and net amount
to be paid. The discount is given according to customer type.
Customer type Discount
Platinum 20%
Gold 10%
Silver 50%
Neither 0%
7. An electronic shop has announced the following seasonal discounts
Purchase Amount Discount on LCD
25000 - 50000 10%
50001-100000 15%
100001-150000 20%
Above 150001 25%
WAP to accept the purchase amount and calculate Discount as well as net amount to be paid
8. WAP to accept three numbers and find the largest of them.
9. WAP to accept the three sides of a triangle and find if given triangle dimensions make a
Pythagoras triangle.
10. WAP to accept the three dimensions of a triangle and find if with given triangle dimensions,
the triangle formation is possible or not.

1
ITERATIVE STATEMENT – LOOPS (NUMERICAL PROBLEMS)
11. WAP to accept a number and display its multiplication table up till the given last number.
12. WAP to give the choice to the user to find the sum of the any of following series:
(i) 1+2+3+……. +N
(ii) 1+3+5+……. +N
13. WAP to compute the sum of the following series:
22+42+62+……. +N2
14. WAP to accept the starting no., ending no., difference in terms of series and display the
series as well as the sum of the series.
15. WAP to Find the sum of series where the starting number, no. of terms in the series and
difference between the terms is accepted. E.g. if beginning number is 3, no. of terms 5 and
difference is 4 then the sum of the terms will be 3+7+11+15+19 = 55
16. WAP to find factors of a given number and also find if the given no. is a perfect no. A
perfect no’s sum of factors excluding itself is equal to the number e.g. 6 (factors 1+2+3 = 6
which is same as 6).
17. WAP to accept the base and exponent and find the power.
18. WAP to accept a number and find its factorial.
19. WAP to compute the sum of the following series:
1+x/1+x2/2+x3/3+ ……. +xN/N
20. WAP to accept a number and find the sum of digits of a number. For example if the given
number is 1672, then the result should be 1+6+7+2=16
21. WAP to find if a given number is an Armstrong number. A number whose sum of the cubes
of its digits is equal to the number. E.g. 153 = 13 + 53 + 33
22. WAP to accept a number and find if it is a prime number.
23. WAP to display Fibonacci series till N terms. i.e if the given value for N is 8 Then Fibonacci
series will be 0 1 1 2 3 5 8 13

SEQUENCES - STRINGS

24. WAP to accept a string and find the number of lowercase alphabets, uppercase alphabets,
digits, blank spaces and special characters in it separately.
25. WAP to accept a string and print the statistics of the string i.e. no of uppercase letters,
lowercase letters, digits, blank spaces and special characters. USE STRING FUNCTIONS
26. WAP to accept a string and a word and find how many times the word occurs in the given
string. USE STRING FUNCTIONS – SPLIT() AND COUNT()
27. WAP to accept a string and find how many words start with a vowel in the given string.
USE STRING FUNCTIONS in this program

SEQUENCES - LISTS

28. WAP to accept numbers in a list and find their sum and average and also conduct linear
search in the list for a particular element accepted from the user.
29. WAP to accept values in a list and find the square of even and cube of odd numbers and
store in a new list.
30. WAP to accept numbers in a list and find the largest number.
31. WAP to accept numbers in a list and find the smallest number.
32. WAP to accept values in a list and swap alternate values of the list.
33. WAP to accept values in a list and swap the first half with the second half of the list.
34. WAP to read a list of n integers (positive as well as negative). Create two new lists, one
having all positive numbers and the other having all negative numbers from the given list.
Print all three lists.
2
35. WAP to find the largest and the second largest elements in a given list of elements.
36. WAP to read a list of N integers and find their median.
37. Write a menu-driven program to read elements of a list and do the following: 1- Insert an
element 2-Delete an element with given index location 3-Delete an element with given
value 4-Exit

COLLECTION - DICTIONARY

38. WAP to accept the names and mobile numbers of N no. of your friends and store them in a
dictionary as key:value pair. The program should then give menu options to the user to
a) display the dictionary items in the following form
Name1 -- Mobile Number1
Name2 -- Mobile Number2
...

b) accept the name and search and display the mobile number
c) accept a name and delete that record
d) accept a name and change the mobile number
e) accept a new name and mobile number and add in the dictionary.
39. WAP to accept and store data of N no. of students in a dictionary, where no. of students
will be input by the user. The roll number of a student will serve as the key and for the
value will be names of the students and their percentage as a list. Display the dictionary
and also delete a record from the dictionary after asking for the key to be deleted from the
user.
40. WAP to accept a string and find how many times each character occurs in the string. Use a
dictionary for storing the result. For example, if the given string is ‘Successful’ then the
dictionary should store
{‘S’:1,’u’:2,’c’:2,’e’:1,’s’:2,’f’:1,’l’:1}

You might also like