Class Xi - Python Practical File Programs 2021-2022 PDF
Class Xi - Python Practical File Programs 2021-2022 PDF
Class Xi - Python Practical File Programs 2021-2022 PDF
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}