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

CS Practical File XII

The document contains a list of 20 Python programming practical assignments to be completed. The practicals cover a range of Python programming concepts including functions, prime number checking, file handling, searching, stacks, tuples, and more. Students are asked to write programs that perform tasks such as basic calculator operations using functions, finding prime numbers from 1 to 100 using a function, reading and processing text and CSV files, implementing linear and binary searches, and creating and manipulating binary files.

Uploaded by

tyagi39
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

CS Practical File XII

The document contains a list of 20 Python programming practical assignments to be completed. The practicals cover a range of Python programming concepts including functions, prime number checking, file handling, searching, stacks, tuples, and more. Students are asked to write programs that perform tasks such as basic calculator operations using functions, finding prime numbers from 1 to 100 using a function, reading and processing text and CSV files, implementing linear and binary searches, and creating and manipulating binary files.

Uploaded by

tyagi39
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

School Name

Session 2023-24

PYTHON PROGRAMMING FILE

SUBMITTED TO SUBMITTED BY

1
LIST OF PRACTICALS:

1) WAP to show functionality of a basic calculator using functions. T.Sign


2) WAP USING a function in python which accept a number from user to return
True, if the number is a prime number else return False. Use this function to
print all prime numbers from 1 to 100.
3) WAP USING a function in python which accept a list of marks of students and
return the minimum mark, maximum mark and the average marks.
4) WAP to read a text file “myfile.txt” line by line and display each word
separated by a #.
5) WAP to read a text file “myfile.txt” and display the number of vowels/
consonants/ uppercase/ lowercase characters in the file.
6) Remove all the lines that contain the character `a' in a file and write it to
another file.(Text file)
7) Write a program to create a text file and print the lines starting with ‘T’ or ‘P’.
(Both uppercase and lowercase).
8) Read a text file to print the frequency of the word ‘He’ and ‘She’ found in the
file.
9) Create a binary file with name and roll number. Search for a given roll number
and display the name, if not found display appropriate message.
10) Create a binary file with roll number, name and marks. Input a roll number and
update the marks.
11) Read a CSV file from hard disc and print all the details on the screen.
12) Read a CSV file (containing item no, name, rate, QOH) from hard disc and
print all the items whose rate is between Rs 500 and Rs 1000.
13) Create a CSV file by entering user-id and password, read and search the
password for given userid.
14) Write a random number generator that generates random numbers between 1
and 6 (simulates a dice). Throw the two dices for 10 times and print their total.
15) WAP in Python to demonstrate linear search.
16) Write a Python program to implement a stack using a list data-structure.
17) WAP to pass an integer list as stack to a function and push only those elements
in the stack which are divisible by 7.
18) Assuming the tuple Vehicle as follows:
( vehicletype, no_of_wheels)
Where vehicletype is a string and no_of_wheels is an integer.
Write a function showfile() to read all the records present in an already
existing binary file SPEED.DAT and display them on the screen, also count
the number of records present in the file.

19) Consider a binary file “Emp.dat '' containing details such as empno:
ename:salary(separator‘:’).Write a python function to display details of those

2
employees who are earning between 20000 and 40000.

20) Write a program to read data from a text file DATA.TXT, and display words
which have maximum/minimum characters.

You might also like