CS_PRACTICAL_FILE
CS_PRACTICAL_FILE
VIDYALAYA ,
PITAMPURA,DELHI-110034
Practical Record File for AISSCE (XII) 2024-25
Examination [As a part of the Computer Science
Subject (083)]
SUBMITTED BY_________________
CLASS – XIIA
Write a Python function DISPLAY_BIG( ) that finds and displays all the words longer
than 5 characters from a text file "Words.txt".
INPUT
OUTPUT
PRACTICAL-2
Write a Python function DISP_WORDS( ) that displays all the words containing @cmail
from a text file "Emails.txt".
INPUT
OUTPUT
PRACTICAL-3
Write a Python function that extracts and displays all the words present in a text file
“Vocab.txt” that begins with a vowel.
INPUT
OUTPUT
PRACTICAL-4
Write a function Count_H( ) in python to count the number of lines in a text file
‘readme.txt’, that contain the word ‘happy’ anywhere in them.
INPUT
Output
PRACTICAL-5
Write a function Count_My( ) in python to read the text file ‘CITY.TXT’ and count the
number of times the word “my” occurs in the file.
INPUT
OUTPUT
PRACTICAL-6
Write a function in WLINE( ) in python to count the number lines in a text file
‘Country.txt’ which is starting with an alphabet ‘W’ or ‘w’.
INPUT
OUTPUT
PRACTICAL-7
Write a function that counts no of words beginning with a capital letter from
INPUT
OUTPUT
PRACTICAL-8
Write a function that displays the line number along with no of words in it
INPUT
OUTPUT
Practical-9
INPUT
OUTPUT
Practical-10
INPUT
PRACTICAL-11
INPUT
OUTPUT
PRACTICAL-12
A csv file " record.csv " contains the data . Each record consists of a list with field
elements as Empid, Name & Sal to store employee id, employee name and employee
salary respectively.
(i) ADD() – To accept and add data of an employee to a CSV file ‘record.csv’.
(ii) COUNTR() – To count the number of records present in the CSV file named
‘record.csv’ whose salary is more than 100000.
INPUT
OUTPUT
PRACTICAL-13
Write a Program in Python that defines and calls the following user defined functions:
(i) ADD() – To accept and add data of an item of shopping mall to a CSV file ‘shop.csv’.
Each record consists of a list with field elements as id, name and price to store item
id, item name and item price respectively.
(ii) COUNTR() – To count the number of records present in the CSV file named
‘shop.csv’.
INPUT
OUTPUT
PRACTICAL-14
INPUT
OUTPUT
PRACTICAL-15
You have a stack named BooksStack that contains records of books. Each book
record is represented as a list containing book_title, author_name, and
publication_year. Write the following user-defined functions in Python to perform the
specified operations on the stack BooksStack: (I) push_book(BooksStack, new_book):
This function takes the stack BooksStack and a new book record new_book as
arguments and pushes the new book record onto the stack. (II)
pop_book(BooksStack): This function pops the topmost book record from the stack
and returns it. If the stack is already empty, the function should display "Underflow".
(III) peep(BookStack): This function displays the topmost element of the stack without
deleting it. If the stack is empty, the function should display 'None'.
INPUT
OUTPUT
PRACTICAL-16
Write the definition of a user-defined function `push_even(N)` which accepts a list of
integers in a parameter `N` and pushes all those integers which are even from the list
`N` into a Stack named `EvenNumbers`.
Write function pop_even() to pop the topmost number from the stack and returns it. If
the stack is already empty, the function should display "Empty".
Write function Disp_even() to display all element of the stack without deleting them. If
the stack is empty, the function should display 'None'.
For example:
[10, 5, 8, 3, 12]
[10, 8, 12]
INPUT
OUTPUT
PRACTICAL-17
There is a stack named Uniform that contains records of uniforms Each record is represented as a list
containing uid, uame, ucolour, usize, uprice. Write the following user-defined functions in python to
perform the specified operations on the stack Uniform : (I) Push_Uniform(new_uniform):adds the new
uniform record onto the stack (II) Pop_Uniform(): pops the topmost record from the stack and returns it.
If the stack is already empty, the function should display “underflow”. (III) Peep(): This function diplay
the topmost element of the stack without deleting it.if the stack is empty,the function should display
‘None’.
INPUT
OUTPUT
PRACTICAL-18
INPUT
OUTPUT
PRACTICAL-19
Write the definition of a user-defined function PUSH_NUM(L) which accepts a list of
integers in a parameter L and pushes all those integers which are either multiple of 3
or 5 from the list L into a Stack named NUMBERS. Write function POP_NUM() to pop the
topmost number from the stack and returns it. If the stack is already empty, the
function should display "Empty". Write function DISP_NUM() to display all element of
the stack without deleting them. If the stack is empty, the function should display
'None'.
INPUT
OUTPUT
Practical-20
INPUT
OUTPUT
PRACTICAL-21
INPUT
OUTPUT
PRACTICAL-22
INPUT
PRACTICAL-23
(A)
(B)
(C)
PRACTICAL-24
INPUT
(A)
(B)
(C)
(D)
OUTPUT
(A)
(B)
(C)
OUTPUT OF (E)
PRACTICAL-25
(I)
(II)
(III)
(IV)
(V)
PRACTICAL-26
(I)
(II)
(III)
(IV)
(V)