Summar Assignment Computer Science Class XII - Practical File Part 1
Summar Assignment Computer Science Class XII - Practical File Part 1
1 Write a program to find a lowest value in a list of numbers entered by the user. 05/05/2025 10/06/2025
2 Write a program to check whether a user given value exists in a dictionary. 05/05/2025 10/06/2025
3 Write a menu-based Python program that contains a function that takes a decimal 06/05/2025 10/06/2025
number (number belongs to the Decimal number system) and also a choice. The
function should convert the given number into its equivalent binary, octal or
hexadecimal number according to the choice given by the user. The result should be
printed in the calling function.(use of built-in functions is allowed)
4 Write a function LShift(arr,n) which accepts a list arr of numbers and n as a numeric 07/05/2025 10/06/2025
value by which all elements of the list are shifted to the left.
5 Write a function that takes a numeric array as an argument and returns a sorted array 07/05/2025 10/06/2025
to the calling function. [Array can be implemented through a list]. Insertion sort
should be used as the sorting technique.
6 Write a function that takes a string and prints the number of uppercase, lowercase 08/05/2025 25/06/2025
characters, digits as well as special characters if any in the string.
7 Write a random number generator function that generates random numbers between 08/05/2025 25/06/2025
1 and 6 (simulates a dice).
8 Write a program that demonstrates the scope resolution rules (LEGB) used by Python 09/05/2025 25/06/2025
when the similar name object is available at various locations of a program. [Proper
documentation should be done to make the concept clear.]
9 Write a program of your choice to demonstrate all types of arguments [formal, 10/05/2025 25/06/2025
actual, default and keyword] which can be used with a function call/ function
definition.
milestokm() kgtotonne()
tonnetokg()
kmtomiles() kgtopound()
feettoinches() poundtokg()
inchestofeet()
Now create a package from above two modules as Conversion→ inside that Length
as a sub package having Lengthconversion.py and Mass as a sub package having
Massconversion.py
Note: Do not write the steps to create package, only write the modules, i.e. the
python files.
11 Read a text file line by line and display each word separated by a # sign. 12/05/2025 15/07/2025
12 Read a text file and display the number of uppercase and lowercase characters in the 13/05/2025 15/07/2025
file
13 Remove all the lines that contain the character ‘a’ in a file and write it to another file. 14/05/2025 15/07/2025
14 Write a method in Python to read lines from a text file India.txt, to find and display 15/05/2025 15/07/2025
the occurrence of the word “India”
______________________________India.txt_____________________________
“India is the fastest growing economy.
India is looking for more investments around the globe.
The whole world is looking at India as a great market.
Most of the Indians can foresee the heights that India is
Capable of reaching.”
__________________________________________________________________
15 Write a function, You() in Python that only the lines which begin from the word 16/05/2025 15/07/2025
‘You’ in text file named Alpha.txt. Also show the total number of such lines.
16 Create a binary file with name and roll number. Search for a given roll number and 17/05/2025 30/07/2025
display the name, if not found display appropriate message.
17 Create a binary file with roll number, name and marks. Input a roll number and 18/05/2025 30/07/2025
update the marks.
18 Create a CSV file by entering user-id and password, read and search the password for 19/05/2025 30/07/2025
a given user.
19 Create a menu driven program for working in a binary file Book.dat with the options 20/05/2025 30/07/2025
like 1. Write 2. Read 3. Update and 4. Delete. The Binary file may have details like
Book_no, Title, Author and Price.
20 Write a program that defines and calls the following user defined functions: 21/05/2025 30/07/2025
a. add() – to accept and add data of an employee to a CSV file ‘furdata.csv’. Each
record consists of a list with field elements as fid, fname and fprice to store furniture
id, furniture name and furniture price receptively.
b. search() – to display the records of the furniture whose price is more than 10000.