Class XII Program File 2
Class XII Program File 2
Note:- Do the following questions in your system and save it, as in future you
1) Write a program for word jumble game where computer will randomly pick a word from a
sequence (tuple). The user would guess a word from the tuple, if it is correct, then print
2) Write a program to create a dictionary containing customer name with respective phone
numbers from user`s choice. Search the name of a customer and print the phone
number of that name. Also, display the details of the dictionary in two column format.
3) Write a program with a user-defined function to read the content from a text file
MAGIC.TXT which counts and displays the number of alphabets, digits, and
Example
The young ones are in age 18 and the children are below 10.
Output:
Total lines : 2
Total alphabets : 88
Total digits are : 6
4) Write a program to delete the file (s) which you want should no longer exist in
your computer. The file name should be entered at the time of program
execution. If the entered file does not exist, display a proper message on screen.
5) Write a function count_A() to count and display the number of lines starting with
There is a playground.
The function should display: Total lines starting with alphabet ‘A’ is :3
FILM = { 'FNo' :<film numbers>, ’FName' : <film name>, 'FType’: <film type>}
(i) Create a pickled binary file CINEMA.DAT, which stores the details of FILMs.
Input the FILM details from user, as long as the user wants.
(ii) Search and display all the content in a pickled file CINEMA.DAT, where
7) Create a CSV file by entering user-id and password, read and search the password for
given userid.