Class 12 Pract
Class 12 Pract
Add record
Display records
Search record
Exit
The structure of file content is: [s_id, name, brand, type, price]
5. Read a text file line by line and display each word separated by a #.
Read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file.
Remove all the lines that contain the character ‘a’ in a file and write
it to another file.
6. Create a binary file with the name and roll number. Search for a
given roll number and display the name, if not found display the
appropriate message.
Create a binary file with roll number, name, and marks. Input a roll
number and update the marks.
7. Write a random number generator that generates random numbers
between 1 and 6 (simulates a dice).
8. Create a student table and insert data. Implement the following SQL
commands on the student table:
ALTER table to add new attributes / modify data type/drop attribute
UPDATE table to modify data
ORDER By to display data in ascending/descending order
DELETE to remove tuple(s).
9. Write a Python program to accept a list as a function parameter and
raise the IndexError exception.
10. Write a program to accept the number of days and display
appropriate weeks in an integer. Display an appropriate error
message through multiple exception handling including the finally
clause.
11. Programs based on data file handling text files
Create a text file “intro.txt” in Python and ask the user to write a
single line of text by user input.
12. Write a program to know the cursor position and print the text
according to the below-given specifications:
Print the initial position
Move the cursor to 4th position
Display the next 5 characters
Move the cursor to the next 10 characters
Print the current cursor position
Print the next 10 characters from the current cursor position
13.
Short Programs