0% found this document useful (0 votes)
7 views

Cs practicals list -2

Uploaded by

heiwa8813
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Cs practicals list -2

Uploaded by

heiwa8813
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

KENDRIYA VIDYALAYA NO.

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

03 Function to reverse a number 20-04-2024

04 Function to find sum of digits of a number 25-04-2024

05 Function to check for Armstrong number 29-04-2024

06 Function to check for palindrome 02-05-2024

08 WAP to show use of Local and global variable 07-05-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)

12 A list, NList contains following record as list elements: 02-07-2024


[City, Country, distance from Delhi]
(i) Push_element(NList): It takes the nested list as an argument and pushes a list object
containing the name of the city and country, which are not in India and distance is less
than 3500 km from Delhi.
(ii) Pop_element(): It pops the objects from the stack and displays them. Also, the
function should display “Stack Empty” when there are no elements in the stack.

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

15 Display the number of vowels/consonants/uppercase/lowercase characters in file 15-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.

PROGRAMS BASED ON STRUCTURED QUERY LANGUAGE-DDL AND DML

25 Create a table student with following structure: 02-09-2024


Adm_no integer primary key
Stu_name string (should not be null)
Class integer,
Section character,
Marks float total 5 characters and decimal 2 characters
Result string 4 characters

Print the structure of the table thus created

26 Insert 5 rows in the above table thus created and show all values entered into the table. 05-09-2024

27 Create a table exam with following structure: 12-09-2024


Exam_id integer primary key
Exam_name string (should not be null)
Exam_date in date format
Adm_id integer that will act as foreign key for adm_no in student table

Print the structure of the table thus created

28 Inset 5 rows in the above table thus created and show all values entered into the table. 15-09-2024

29 Write DML SQL commands to show the use of: 20-09-2024


a. Update command
b. Pattern Matching % and _
c. Order by ascending and descending

30 Write DDL commands to show the use of: 25-09-2024


a. Altering table structure by adding, modifying and dropping columns
b. Altering table structure by adding, modifying and dropping constraints

You might also like