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

CS_PRACTICAL_FILE

The document outlines a practical record file for the AISSCE (XII) 2024-25 examination in Computer Science. It includes a series of Python programming tasks that require students to create functions for various text file manipulations, such as counting words, extracting specific data, and managing stack operations. Each practical task is designed to assess the student's programming skills and understanding of file handling in Python.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

CS_PRACTICAL_FILE

The document outlines a practical record file for the AISSCE (XII) 2024-25 examination in Computer Science. It includes a series of Python programming tasks that require students to create functions for various text file manipulations, such as counting words, extracting specific data, and managing stack operations. Each practical task is designed to assess the student's programming skills and understanding of file handling in Python.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

PM SHRI KENDRIYA

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

Roll No. ___________

Under the Guidance of: MR. VIJAY CHAWLA PGT


(Computer Science)
Practical-1

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

the text file RatanJi.txt.

INPUT

OUTPUT

PRACTICAL-8

Write a function that displays the line number along with no of words in it

from the file Quotes.txt

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.

Write user defined functions s in Python that defines the following:

(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:

If the integers input into the list `VALUES` are:

[10, 5, 8, 3, 12]

Then the stack `EvenNumbers` should store:

[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)

You might also like