DAV PUBLIC SCHOOL, KAILASH HILLS
Session 2021-22
PYTHON
PROGRAMMING FILE
MADE BY-
NAME :__________________
CLASS : XII-Science
ROLL NO :________
ACKNOWLEDGEMENT
In the accomplishment of these Practicals successfully,
many people have bestowed upon me their blessings and
heart pledged support, this time I am utilizing to thank all
the people who have been concerned with these
practical.
Primarily I would thank God, for being able to complete
these Practicals with success. Then I would like to thank
my Computer Science teacher Mr. Lalit Bhardwaj, whose
valuable guidance has been the ones that helped me
patch this project and make it full proof success ,his
suggestions and his instructions has served as the major
contributor towards the completion of these Practicals.
Then I would like to thank my parents and friends who
have helped me with their valuable suggestions and
guidance, which proved to be helpful in various phases of
the completion of these Practicals.
Public School, Sahibabad
DEPARTMENT OF COMPUTER
CERTIFICATE
This is to certify that _________________, a student of class XII-
Scienc has successfully completed these practicals under the
guidance of Mr. Lalit Bhardwaj (SubjectTeacher)
During the academic year 2020-21 in partial fulfilment of
computer practical
examination conducted by AISSCE, New Delhi.
Signature of Computer Science Teacher
Signature of External Examiner
list of programs
S.no Programs Page no. Teacher’s
Signature
1 WAP to counts the number of alphabets ,digits, uppercase,
lowercase, # spaces and other characters(status of a string).
2 WAP to remove all odd numbers from the inputted list.
3 Program to enter any number and print factorial of this
number. Also check whether this number is prime number
or not.
4 Program to find the max, min and mean of values from a
inputted list.
5 Program to store student’s information in a dictionary and
display information on the basis of admission no.
6 Write a function roll_D ( ), that takes 2 parameters- the no.
of sides (with default
value 6) of a dice, and the number of dice to roll-and
generate random roll values
for each dice rolled. Print out each roll and then return one
string “That’s all”.
Example roll_D (6, 3)
4
1
6
7 Write a program to swap the content with next value, if it is
divisible by 7 so that the resultant array will look like :
3,5,21,6,8,14,3,14.
8 Write a program to display those string which are starting
with ‘A’ from the given list.
9 Write a user defined function to find the greatest common
devisor between two numbers.
10 Write a user defined function to display first n prime
numbers.
11 Program to calculate income tax of an employee on the
basis of basic salary and total savings inputted by the user.
12 WAP to calculates the following using concepts of module:
1. Area of Circle
2. Circumference of a circle
3. Area of rectangle
4. Perimeter of a rectangle
13 WAP to print the number of occurrences of a substring into
a line using built in string function find().
14 Write a program to show and count the number of words in a
text file ‘DATA.TXT’ which is starting/ended with an word
‘The’, ‘the’.
15 Consider a binary file “Emp.dat” containing details such as
empno: ename: salary(separator‘:’).Write a python function
to display details of those employees who are earning
between 20000 and 40000.
16 Write a program to enter the numbers and find Linear
Search, Binary Search, Lowest Number using array code
with user defined functions.
17 Write a function to create a copy of file “test.txt” named as
“file.txt” which should convert the first letter of the file and
the first alphabetic character following a full stop into upper
case.
18 Anant has been asked to display all the students who have
scored less than 40 for Remedial Classes. Write a user-
defined function to display all those students who have
scored less than 40 from the binary file “Student.dat” and
copy their records to new file “stud.dat”
19 Create a CSV file “Groceries” to store information of
different items existing in a shop. The information is to be
stored w.r.t. each item code, name, price, qty. Write a
program to accept the data from user and store it
permanently in CSV file.
20 Write a menu-driven program implementing user-defined
functions to perform different functions on a csv file
“student” such as:
(a) Write a single record to csv. (b) Write all the records in
one single go onto the csv.
(c) Display the contents of the csv file.