Practical File Cs
Practical File Cs
Coding—
Output—
Computer science practical file – 2023-24
Practical 2:- To accept a number from user return True, if the number is a prime number else
return false and prime all prime number from 1 to 100.
Coding—
Output—
Computer science practical file – 2023-24
Practical 3 :- To accept a list of marks and return the minimum, maximum, average marks.
Coding—
Output—
Computer science practical file – 2023-24
Practical 4:- To read a text file line by line and display word separated by a “#”.
Coding—
Output—
Computer science practical file – 2023-24
Practical 5:- To count the number of vowels/consonants/uppercase/letters/lowercase letter in
a text file.
Coding—
Output—
Computer science practical file – 2023-24
Practical 6:- To remove all the lines that contain the character ‘a’ in a file and write it to
another file.
Coding—
Output—
Computer science practical file – 2023-24
Practical 7:- To create a text file and print the line which are starting with ‘T’ or ‘P’.
Coding—
Output—
Computer science practical file – 2023-24
Practical 8:- Write a program to read data from data file in read mode and count the particular
word occurrences in given string, number of times in python.
Coding—
Ourpur
Computer science practical file – 2023-24
Practical 9:- To read a text file and print the frequency of the word ‘H’ and ‘She’ found in the
file.
Coding—
Output—
Computer science practical file – 2023-24
Practical 10:- To create a binary file with name and roll number and display the name, if not
found display appropriate message.
Coding—
Output—
Computer science practical file – 2023-24
Practical 11:- To read a CSV file from the hard disc and print all the details on the screen.
Coding—
Output—
Computer science practical file – 2023-24
Practical 15:- To create random number generator that generates random number between 1
and 6. Also throw the dices 10 times to print their total.
Coding—
Output—
Computer science practical file – 2023-24
Practical 16:- To write a python program to implement a stack using a list- data structure.
Coding—
Output—
Computer science practical file – 2023-24
Practical 17:- To pass a integer list as stack to a function and push only those elements in the
stack which are divisible by 7.
Coding—
Output—
Computer science practical file – 2023-24
Practical 14 : – To create a binary file with roo number, name and marks. Input a roll number
and update the marks.
Coding—
Output—
Computer science practical file – 2023-24
Practical 18:- To connect python with Mysql using database connectivity and perform the
following operation on the data in database. Create a table in Database.
Coding—
Output—
Computer science practical file – 2023-24
Practical 19:- To connect the python with Mysql using database connectivity and perform the
following operation on data in database. Insert Record in table.
Coding—
Output-
Computer science practical file – 2023-24
Practical 20 :– To connect the python with MySql using database connectivity and perform the
following operation on data in database. Fetch records from the table using fetchone(),
fetchall() and fetchmany().
Coding—
Computer science practical file – 2023-24
Output—
Computer science practical file – 2023-24
Practical 21:- To connect the python with MySql using database connectivity and perform the
following operation on data in database. Update record in the table.
Coding—
Output –
Computer science practical file – 2023-24
Practical 22:- To connect the python with MySql using database connectivity and perform the
following data in database. delete record in the table.
Coding—
Output--
Computer science practical file – 2023-24
Computer science practical file – 2023-24
Practical 23:- To write a queries using create database, show databases, use, create table, show
tables, describe, alter, select, from, where, insert, update commands.
Computer science practical file – 2023-24
Computer science practical file – 2023-24
Practical 24- To write a queries using DISTINCT, BETWEEN, IN, LIKE, ISNULL, ORDER BY,
GROUP BY, HAVING
Computer science practical file – 2023-24
Computer science practical file – 2023-24
Practical 25- To write a queries using function – sum(), avg(), min(), max(), count().