Python
Python
1. Write a function in Python that counts the number of “Me” or “My” words present
in a text file “STORY.TXT”
2. Write a program using function SUMFUN( ) with arguments X and N which
returns the sum of N terms of the following: x-x3 /3 + x5 /5 – x7 /7 + x9 /9…..
1. Write a python program using function PUSH(Arr), where Arr is a list of numbers.
From this list push all numbers divisible by 5 into a stack implemented by using a
list. Display the stack if it has at least one element, otherwise display appropriate
error message.
2. Program to write data in a csv file student.csv. and then read and display the data
from student.csv file.
1. Write a program to accept an array of marks of ten students and sort using
Bubble/Selection sort.
2. Write a python program using function POP(Arr), where Arr is a stack
implemented by a list of numbers. The function returns the value deleted from the
stack.
1. Write a program in python to create a stack “student” with details of student name
and their marks. Write Operation for Push, Pop and Traversal operation using menu.
2. WAP to open a file and count the Number of Lines, No. of Words and No. of
Characters in a given file.
SAINIK SCHOOL AMBIKAPUR
COMPUTER SCIENCE (083) , PRACTICAL EXAMINATION 2024-25
1. Write a Program to create a binary file to store roll number and name and search any
roll number and display the respective name.
2. Write a python program to create a stack of Book’s record which contains [Book
code, Book title, Book price].
Write function PUSH to add record into the stack
Write function POP and display the record in the stack
1.Write a function in Python that counts the number of “this” or “that” words present
in a text file “STORY.TXT”
2. Write a python program to create stack Sport_Stack to store age of sportsman using
stack implementation as list. Write Operation for Push, Pop and Traversal operation
using menu.
1. Write a function in Python that counts the number of “Me” or “My” words present
in a text file “WORD.TXT”
2. Write a python program to create a stack of Book’s record which contains [Book
code, Book title, Book price].
Write function PUSH to add record into the stack
Write function POP and display the record in the stack
1.Write a function in Python that counts the number of “this” or “that” words present
in a text file “STORY.TXT”
2. Write a Menu driven program to implement stack:
Push
Pop
Peek
Display
Exit
SAINIK SCHOOL AMBIKAPUR
COMPUTER SCIENCE (083) , PRACTICAL EXAMINATION 2024-25
1.Write a function in Python that counts the number of “this” or “that” words present
in a text file “STORY.TXT”
2. Write a python code to create a SQL table Cadet (using pymysql interface ) with
following specifications:
Schno – int – size 4 – Primary Key
Name – char – size 15
DOB – Date
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is ssap
Insert one row as given below:
SchNo Name DOB
851 Shivam Kumar 21-06-2007
1. Write a function in Python that counts the number of “Me” or “My” words present
in a text file “WORD.TXT”
2. Write a python code to create a SQL table Student (using pymysql interface )
with following specifications:
Admno – int – size 4 – Primary Key
SName – char – size 15
DOB – Date
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is tiger
Insert one row as given below:
AdmNo SName DOB
1229 Harsh Bhati 21-03-2006