Class Xii (2024 25)
Class Xii (2024 25)
20. WAP in python to generate 10 six digit OTP using random module.
E.g. OTP-210703
21. WAP in python to generate 10 OTP using random module as per the following.
E.g. OTP-W8T9F2
22. WAP in python to define a function Paragarph() to create a text file “Notebook.txt” to write
few lines into it. If you don’t want to write more lines then enter 0(zero) to quit the function.
23. WAP in python to define a function Display() to read a text file “Python.txt” and display how
many vowels in it.
24. WAP in python to define a function Display() to read a text file “Python.txt” and display how
many words starting with letter ‘O’ in it.
25. WAP in python to define a function Display to read a text file “Python.txt” and display how
many words ends with digit.
26. WAP in python to define a function Lines() to read the text file Notebook.txt and display all
lines available in the file with line number.
27. WAP in python to create a text file ‘Admission.txt’ where the names of all the students who
have taken admission in XI are stored along with Admission no and Steram. Write a function
Add_Name() in python to update the text file Admission.txt to add new names in the existing
file. Open the file in append mode and add the names till you want. If you don’t want to add
more names the enter 0(zero) to quit the function.
28. WAP in python to define a function Shift_Name() in python to copy the names of the students
of ‘Science’ stream in another text file ‘Science.txt’ from ‘Admission.txt’ file. finally, display
all the records of the file ‘Science.txt’.
29. WAP in python to define a function Line() to read a text file “Python.txt” and display the line
which have more than 8 words.
30. WAP in python to
(a). Define a function Sports() to create a Binary file ‘Prize.dat’ store the records comprising
Name, Class, and Rank of all the ‘Prize Winners’ of class X, XI, and XII students.
(b).WAP in python to define a function PrizeWinner() to read a Binary file ‘Prize.dat’ and
display all the names along with the class and Rank, who have secured ‘Rank’ as 1(One) in
the format shown below:
Name Class Rank
Arjun Sing XII-A 1
…………. ……… …….
31. WAP in python to
(a). Define a function ‘NAMELIST():’ to create a binary file “Name.dat” where you ask user
to insert some name in list and Store the list in “Name.dat” file.
(b). Define a function ‘Count():’ to count and display the number of lowercase and uppercase
letters in each name, available in the file.
32. WAP in python to
(a). Define a function Phone(): to create a binary file “Contact.dat” to insert Name and Phone
No. of few persons in any object(list, tuple, dictionary) and it in binary file.
(b). Define a function Search(): to search a name in the file ”Contact.dat”. If the name is found
the display “The record is found”, otherwise display ‘No such name is available’ in the
file.
33. WAP in python to
(a). Define a function “Result():” to create a binary file “Results.dat” to store names and marks
in English, Math and Computer of all the students of class XII.
(b). Define a function “Result_Disp():” to display the names of all the students who have
secured 90% and above in English, Math, and Computer Science.
34. WAP in python to
(a). Define a function CreateTrip(): to create a csv file “Holidays.csv” to keep the records of
holidays package trips for different places with their tariffs. The format is as shown below:
Type Trip Days TourCost
A01 Delhi-Agra 2 5000
A02 Delhi-Goa 3 8000
…… …………. …… …………..
(b). Define a function ShowTrip(): to read all the records of the file “Holiday.csv” and display
the details of holidays package trips for different places with their tariff.
35. WAP in python to
(a). Define a function CreateMedals(): to create a csv file “Sports.csv” to keep the records of
number of medals won by each school in the Inter school Sports Meet. The format is as
shown below:
SchoolName Gold Silver Bronze
Valley Green 1 2 4
Hill View 3 5 7
Blue Bells 2 8 6
…………..… …. …. ….
(b). Define a function ShowMedals(): to read all the records of the file “Sports.csv” and
display the total number of medals won by particular school.
The User enters the name of a school to display the total number of medals won, if the name
doesn’t exist the it display an appropriate message.
36. WAP in python to
(a). Define a function CreateSalary(): to create a csv file “Employee.csv” to keep the records
of salary of employees under different fields as mention below:
EmpCode EmpName Grade Salary
E01/01 Anand Mishra SP4 45000
E01/02 Ramesh Shukla SP3 41000
……… ………………... …. ….….
(b). Define a function ShowSalary(): to read all the records of the file “Employee.csv” and
display the records of all those employees whose salary is 40,000 or above.
37. WAP in python to implement a stack to store the temperatures in degree Celsius such that the
temperatures that is entered into stack last can be accessed first. Perform the following
operations with the details, given below:
(i) Push(MyStack,tmp): To push the temperatures (tmp) into the stack (MyStack).
(ii) Peek(MyStack): Displays the topmost temperatures of Stack.
(iii) Display(MyStack): Displays the stack elements
Now,
perform the function Push() and Display() using user’s choice.
38. WAP in python to implement a stack to manage different city names with the details given
below:
(i). MyStack[]: A Stack as a list to hold the city name.
(ii). MakePush(MyStack): To push a city name at the top of the stack. Display the following:
(i). Index of the topmost city
(ii). Topmost city name
(iii). All the city name of the stack
(iii). MakePop(MyStack): To remove a city name from the top of the stack. If the stack is
empty, display the message “Underflow” else display the popped out
item.
Now, Perform the functions MakePush() and MakePop() as per the user’s choice. Under
what principle does the entity work.