Cs practicals list -2
Cs practicals list -2
2, NHPC CHAMERA
LIST OF PRACTICALS FOR ACADEMIC SESSION 2024-25 CLASS XII CS(083)
S.N Practical's name Date
PROGRAMS BASED ON LIST, TUPLE DICTIONARY, TEXT FILE, BINARY FILES, CSV AND STACKS
01 MDP for creation, insertion, updating, deletion and exit in a List 10-04-2024
02 MDP for creation, insertion, updating, deletion and exit in a dictionary 15-04-2024
09 Write a function INDEX_LIST(L), where L is the list of elements passed as argument to 22-06-2024
the function. The function returns another list named ‘indexList’ that stores the indices of
all Non-Zero Elements of L. For example: If L contains [12,4,0,11,0,56] The indexList
will have - [0,1,3,5]
10 Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as 25-06-2024
an argument and displays the names (in uppercase)of the places whose names are
longer than 5 characters. For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"} The output should be:
LONDON NEW YORK
11 Write a function, lenWords(STRING), that takes a string as an argument and returns a 29-06-2024
tuple containing length of each word of a string. For example, if the string is "Come let
us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)
13 Write a random no. generator that generates random no.s between 1 to 6(simulates a 05-07-2024
die)
14 Write a program to create a fibonacci series upto n terms using tuple. 09-07-2024
16 Remove all the lines that contain the character 'a' in a file and write it to another file 20-07-2024
17 Create a binary file with name and roll number. Search for a given roll number and 25-07-2024
display the name, if not found display appropriate message.
18 Create a binary file with roll no. ,name and marks. Input a roll no. and update the marks 28-07-2024
19 Function vowel_count() that count and displays number of vowels in the file Poem.txt 03-08-2024
20 Function to read a text file,Alpha.txt and display those lines which begin with the word 05-08-2024
'You'
21 Read a text file line by line and display each word separated by a # 12-08-2004
22 Function Push(SItem) where , SItem is a dictionary containing the details of stationery 15-08-2024
items– {Sname:price}. The function should push the names of those items in the stack
who have prices greater than 75. Also display the count of elements pushed into the
stack.
23 Create a csv file named Result.csv, to store the results of students in different sports 20-08-2024
events.
The structure of Result.csv is : [St_Id, St_Name, Game_Name, Result]
Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'
For efficiently maintaining data of the event, write the following user defined functions:
Accept() – to accept a record from the user and add it to the file Result.csv. The column
headings should also be added on top of the csv file.
wonCount() – to count the number of students who have won any event.
24 Write a Program in Python that defines and calls the following user defined functions: 25-08-2024
(i) 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 respectively.
(ii) search()- To display the records of the furniture whose price is more than 10000.
26 Insert 5 rows in the above table thus created and show all values entered into the table. 05-09-2024
28 Inset 5 rows in the above table thus created and show all values entered into the table. 15-09-2024