You are on page 1of 28

ACADMIC YEAR 2021-2022

COMPUTER SCIENCE
PRACTICAL FILE

NAME: C.P.DHANUSH
CLASS: XII ‘A’
SCHOOL: KENDRIYA VIDYALAYA
OCF
ROLL NO: 12110
2

Date
Aim
1. To write a python program to pass a 12.6.21
list to a function and double the odd
values and half
Even values of a list and display list
elements after changing.

2. To write a Python program input n 23.6.21


number in tuple and pass it to function
to count how
Many even and odd numbers are
entered.

3. To write a Python program to function 23.6.21


with key and value, and update value
at that key
In the dictionary entered by the user.

4. To write a Python program to pass a 5.7.21


string to a function and count how
many vowels
Present in the string.

5. To write a Python program to 5.7.21


generate (Random Number) that
generates random
3

Numbers between 1 and 6 (simulates a


dice) using a user defined function.

6. To write a menu driven python 5.7.21


program to implement 10 python
mathematical functions.

7. To write a python program to 29.7.21


implement python string functions.

8. To write a menu driven program in 29.7.21


python to delete the name of a student
from the
Dictionary and to search phone no of
a student-by-student name.

9. To write a python program to read 15.8.21


and display file content line by line
with each word
Separated by #.

10. To write a python program to read a 15.8.21


text file and display the number of
consonants, vowels, uppercase,
lowercase characters in the file.

11 To write a Menu driven program in 16.8.21


python to count spaces, digits, words
and lines
from text file TOY.txt
4

12. To write a python program to remove 25.8.21


all the lines that contain the character
„a‟ in a file and write it to another
file.

13. To write a python program to create a 25.8.21


binary file with name and roll number.
Search for
A given roll number and display name,
if not found display appropriate
message.

14. To write a python program to create a 27.8.21


dictionary with roll number, name and
marks.
Accept 5 records from the user and
write them into a binary file.

15. To write a python program to create a 27.8.21


CSV file by entering user-id and
password, read and search the
password for given user-id.
5

Practical 1
Aim:To write a python program to pass list to a function and
double the odd values and half even values of a list and display list
element after changing.

Software Used:IDLE(Python 3.8 32-bit)


Code:

Output :

Practical 2
6

Aim:To write a Python program input n numbers in tuple and pass it to


function to count how many even and odd numbers are entered.

Software Used:IDLE(Python 3.8 32-bit)


Code:

Output :

Practical 3
Aim:To write a Python program to function with key and value, and
update value at that key in dictionary entered by user .

Software Used:IDLE(Python 3.8 32-bit)


7

Code:

Output :

Practical 4
Aim:To write a Python program to pass a string to a
function and count how many vowels present in the string.

Software Used:IDLE(Python 3.8 32-bit)


8

Code:

Output :

Practical 5
Aim:To write a Python program to generator (Random
Number) that generates random numbers between 1 and 6
(simulates a dice) using user defined function.

Software Used:IDLE(Python 3.8 32-bit)

Code:
9

Output :

Practical 6
Aim:To write a menu driven python program to
implement 10 python mathematical functions.
Software Used:IDLE(Python 3.8 32-bit)
Code:
10

Output :
11

Practical 7
12

Aim:To write a python program to implement python


string functions.
Software Used:IDLE(Python 3.8 32-bit)

Code:

Output:
13

Practical 8
14

Aim:To write a menu driven program in python to


delete the name of a student from the dictionary and to
search phone no of a student by student name.
Software Used:IDLE(Python 3.8 32-bit)
Code:

Output :
15

Practical 9
16

Aim: To write a python program to read and display


file content line by line with each word separated by # .

Software Used:IDLE(Python 3.8 32-bit)

Code:

Text File used:


17

Output:

Practical 10
18

Aim:To write a python program read a text file and


display the number of vowels, consonants, uppercase,
lowercase characters in a file.
Software Used:IDLE(Python 3.8 32-bit)

Code:

Text file used:


19

Output:

Practical 11
20

Aim:To write a Menu driven program in python to


count spaces, digits, words and lines from text file TOY.txt

Software Used:IDLE(Python 3.8 32-bit)

Code:

Text file used:


21

Output:

Practical 12
22

Aim:To write a python program to remove all the lines


that contain the character „a‟ in a file and write it to
another file.

Software Used:IDLE(Python 3.8 32-bit)

Code:

Text file used:


23

Output:

Output Text File Produced:

Practical 13
Aim: To write a python program to create a binary file
with name and roll number. Search for a given roll number
24

and display name, if not found display appropriate


message.
Software Used:IDLE(Python 3.8 32-bit)
Code:

Output :
25

Practical 14
Aim: To write a python program to create a dictionary with roll number, name
and marks. Accept 5 records from the user and write them into a binary file.
26

Software Used:IDLE(Python 3.8 32-bit)

Hardware used: Keyboard, Monitor, Mouse, Hard disc, RAM

Code:

Output:

Practical 15
Aim:To write a python program to create a CSV file by
entering user-id and password, read and search the
password for given user-id.
27

Software Used:IDLE(Python 3.8 32-bit)

Code:

Output :
28

************THANK
YOU************

You might also like