Nothing Special   »   [go: up one dir, main page]

CS Practical Gulshan Kumar

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

INGRAHAM ENGLISH MEDIUM SCHOOL

Session 2022-2023
Computer practical file

Submitted By : Gulshan kumar


Submitted To: Jyoti Arora Ma’am
Class : 12th
section: B
Roll No :
Acknowledgement
I take immense pleasure in thanking Mrs Jyoti
Arora for having permitted me to carry out this
project work.
Needless to mention that he had been a
source of inspiration and for his timely
guidance in the conduct of our project work.
Words are inadequate in offering my thanks to
ma’am, for her encouragement and
cooperation in carrying out the project work.
Finally, yet importantly, I would like to
express my heartfelt thanks to our school
principal for help and wishes for the
successful completion of this project.
CERTIFICATE
This is to certify that this project
work is submitted by Gulshan kumar,
a student of class XII - B
The aforesaid project was originally
carried out under the guidance and
supervision of Mrs Jyoti Arora, P.G.T
(CS) during the academic year 2022-
2023.
Signature of CS
Teacher
Signature of External Examiner
Index
1. Write a program in python to check a number whether it is
prime or not.
2. Write a program to check a number whether it is palindrome or
not.
3. Write a program to display ASCII code of a character and vice
versa.
4. Write a function Swap Numbers( ) to swap two numbers and
display the numbers before swapping and after swapping.
5. Write a program to compute GCD and LCM of two numbers
using functions.
6. Write a function FACT( ) to calculate the factorial of an integer.
7. Write a program to generate random numbers between 1 to 6
and check whether a user won a lottery or not.
8. Write a program to count the number of vowels present in a text
file.
9. Write a program to write those lines which have the character
'p' from one text file to another text file.

10.Write a program to count number of words in a file.

11.Write a python program to write student data in a binary file.

12.Write a python program to read student data from a binary file


1. Write a program in python to check a number whether it is
prime or not.

CODE:

OUTPUT:
2. Write a program to check a number whether it is palindrome or
not

CODE:

OUTPUT:
3. Write a program to display ASCII code of a character and vice
versa.

CODE:

OUTPUT:
4. Write a function SwapNumbers( ) to swap two numbers and
display the numbers before swapping and after swapping.

CODE:

OUTPUT:
5. Write a program to compute GCD and LCM of two
numbers using functions

CODE:

OUTPUT:
6. Write a function FACT( ) to calculate the factorial of an
integer .

CODE:

OUTPUT:
7. Write a program to generate random numbers
between 1 to 6 and check whether a user won a lottery
or not.

CODE:

OUTPUT:
8. Write a program to count the numbers of vowels
present in a text file.

CODE:

OUTPUT:

Text file:
9. Write a program to write those lines which have the character 'p'
from one text file to another text file.

CODE:

OUTPUT:

Text File:
10. write a program to count number of words in a file
CODE:

OUTPUT:

Text file:
11. Write a python program to write student data in a
binary file.
CODE:

OUTPUT:

Binary file:
12. Write a program to read student data from a
binary file.
CODE:

OUTPUT:
13.Write a python program to modify/update student data
in a binary file.
CODE :

OUTPUT:
14.Write python program to delete student data from binary
file
CODE :

OUTPUT:
15.Write a python program to search a student record in
binary file
CODE :

OUTPUT :
16.Write a python program to read and write operation with
.CSV file.
CODE :
OUTPUT :
17.create a CSV file by entering user id and password, read
and search the password of the given user id.

OUTPUT:
18.Write an python program for linear search.

CODE:

OUTPUT :
21. Queries using Create database, Show databases, USE,
Create table, Show Tables, Describe, Rename, Alter, Select,
From, Where, Insert, Update commands.

CODE :
1)create Database: 2)Show databases:

3) Use database 4)Create table:

5)Show Tables:
6)describe table:

7)Rename Table:
8)Select and from command: 9)Alter :

11)Insert command;

12)Update command
22. Queries using DISTINCT, BETWEEN, IN, LIKE, IS NULL, ORDER
BY, GROUP BY, HAVING

1)Distinct function:

2)Between function:

3)IN function:

4) like function:

5)isnull function:

6)order by function:

7)group by function:

8)having function:
23. Queries for Aggregate functions- SUM( ), AVG( ), MIN( ),
MAX( ), COUNT( )
1)SUM():

2)AVG():

3)MIN():

4)MAX():

5)COUNT():
24. Write a program to connect Python with MySQL using
database connectivity and perform the following operation
on data in database: Create a table in database.
CODE:

OUTPUT:

SQL TABLE:
25. Write a program to connect Python with MySQL using
database connectivity and perform the following operation
on data in database: Insert record in the table.
Code

Output
26. Write a program to connect 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( )
CODE fetchone(): OUTPUT:

CODE fetchall(): OUTPUT:

CODE fetchmany(): OUTPUT:


27. Write a program to connect Python with MySQL using
database connectivity and perform the following operation
on data in database: Update record in the table

CODE:

OUTPUT:
28.Write a program to connect Python with MySQL using
database connectivity and perform the following operation
on data in database: Delete record from the table

CODE:

OUTPUT:

You might also like