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

Cs Class 12 Term 1 Project

This document contains details of 15 Python programming practical assignments completed by a student. Each practical has the aim, code, and output related to writing programs involving lists, tuples, dictionaries, strings, files, and more. The practicals cover concepts like passing data to functions, mathematical operations on lists, reading and writing to different file types, and menu-driven programs. Overall, the document provides a record of the programming tasks and skills learned by the student over the academic year.

Uploaded by

NØ RÙĪZ
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views

Cs Class 12 Term 1 Project

This document contains details of 15 Python programming practical assignments completed by a student. Each practical has the aim, code, and output related to writing programs involving lists, tuples, dictionaries, strings, files, and more. The practicals cover concepts like passing data to functions, mathematical operations on lists, reading and writing to different file types, and menu-driven programs. Overall, the document provides a record of the programming tasks and skills learned by the student over the academic year.

Uploaded by

NØ RÙĪZ
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

ACADEMIC YEAR 2021-

2022
COMPUTER SCIENCE
PRACTICAL FILE

NAME:DISHANTH .R
CLASS: XII ‘A’
SCHOOL: KENDRIYA VIDYALAYA
OCF
2

ROLL NO: 12106

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 generate 5.7.21


(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 and 15.8.21


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:

Output:
17

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

Text file used:

Output:
20

Practical 11
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:
21

Text file used:

Output:
22

Practical 12
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
24

Aim: To write a python program to create a binary file with


name and roll number. Search for a given roll number 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:
27

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.
Software Used:IDLE(Python 3.8 32-bit)

Code:
28

Output :
29

#########THANK
YOU###########

You might also like