0% found this document useful (0 votes)
20 views23 pages

Computer Science

Uploaded by

factsmind993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views23 pages

Computer Science

Uploaded by

factsmind993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Computer

Science
Practical
Programs
For Grade – X I [2024-2025]
Code – 083

Name: Ishika
Class: XII SCI.
Roll Number:
17
Iwishtoexpress my deep
senseof gratitude and indebtedness to
our learned teacher
Mrs. Neetu Saini , Vishal International
Schoolfor herinvaluable help, advice,
andguidance in the preparation
of this project. I amalso greatly
indebtedto our principal
Mrs. Sunita Bhan
and school authorities for providing
mewiththe facilities andrequisite
laboratory conditions for making this
practical file. Ialsoextendmy thanks
toseveral teachers, my classmates
andfriends whohelped metocomplete
this practical file successfully.
Ishika Thakur
This is to certify that Ishika Thakur
student of Class XII (A), VISHAL
INTERNATIONAL SCHOOL has
completed the practical file during
the academic year 2024 – 2025
towards partial fulfilment of credit
for the Computer Science
practical evaluation of CBSE - 2025
and submitted satisfactory report, as
compiled in the following pages, under
my supervision.

Internal examiner External examiner

School stamp
Seri PROGRAMS SIGNATU
al RE
No
.
1. Creatinga python programto display Fibonacci series.

2. Creating a menu driven program to findfactorial and


sum of list of numbers using function.

3. Creatinga python programto implementreturning


value(s)fromfunction.
4. Creatinga python programto implementmathematical
functions.

5. Write a function in python which accept a list of marks


of students and return the minimummark, maximum mark
and the average marks. Use the samefunction totest.

6. WAP to read a text file “ myfile.txt” line by line


and display each word separated bya #.

7. WAP to read a text file “ myfile.txt” and display


the number of vowels/
consonants/uppercase/lowercasecharacters inthe file.

8. Remove all the lines that contain the character `a' in a


file and write it to another file.

9. Write a program to create a textfile and print


thelines starting with ‘
T’ or‘
P’ . (Bothuppercaseandlowercase).
10. Read a text file to print the frequency of the word ‘
He’ and ‘
She’ found
inthe file.
11. Create a binary file with name and roll number.
Search for a given ro l number anddisplaythename,
ifnotfound displayappropriate message.
12. Create a binary file with ro l number, name and marks.
Input a roll number andupdatethemarks.

13. Read aCSVfilefromharddisc andprinta l


thedetailsonthescreen.
14. Create a CSV file by entering user-id and password,
read and search the password forgiven userid.

15. Creatinga python programto implementstackoperations.

16 Queries using Create database, Show databases, Use,


Create table, Show Tables, Describe,Rename, Alter,
Select, From, Where, Insert, Update commands.

17. Queries using ORDERBY, GROUP BY, HAVING.

18. Queries for Aggregate functions- SUM(), AVG(), MIN( ),


MAX( ), COUNT()
19. WAP to connect Python with MySQL using database
connectivity and perform thefollowing operation on
data in database: Create a table in database.

20 WAP to connect Python with MySQL using database


connectivity and perform thefollowing operation on
data in database: Insert record in the table.
1. Creating apythonprogramtodisplay Fibonacci series.

Output:-

2. Creating a menu driven programto find factorial and sumof list of


numbers using function.

Output :-
3. Creating apython programtoimplementreturning value(s)fromfunction.

Output :-

4. Creating apython programtoimplement mathematical functions.

Output :-

5. Writea function inpython which accepta list ofmarks ofstudents


andreturn theminimum mark, maximummarkand theaveragemarks.
Usethesamefunction totest.
Output :-

6. WAPtoread atextfile“ myfile.txt” linebyline


anddisplayeach word separatedbya #.

Output :-

7. WAP toreada textfile“


myfile.txt” anddisplaythenumber ofvowels/
consonants/uppercase/lowercasecharacters inthe file.
Output :-

8. Remove all the lines that contain thecharacter `a' inafile


andwriteittoanother file.

Output :-

9. Write
aprogramtocreatea text file andprint the lines starting with‘
T’ or‘P’ .
(Bothuppercaseandlowercase).
Output :-

10. Read
atextfiletoprintthefrequencyof the word‘ He’ and ‘She’ foundin
thefile.

Output :-

11. Createa binaryfile with nameand roll number. Search foragiven


roll number anddisplaythe name, ifnotfound displayappropriate
message.
Output :-

12. Create abinaryfilewith roll number, nameandmarks. Inputa


roll number and updatethe marks.
Output :-

13. Reada CSVfilefromhard disc andprint all the details on thescreen.


Output:-

14. Createa CSVfilebyenteringuser-idand password,


readandsearchthepassword forgiven userid.

15. Creatinga python programto implementstackoperations.


Output:-

16. Queries using Createdatabase, Showdatabases, Use,


Createtable, ShowTables, Describe,Rename, Alter, Select,
From, Where, Insert, Update commands.
: Creates a newdatabase.
: Displays all thedatabases available.
: Selects adatabasetowork with.
: Creates atable with specified columns.
: Listsa l thetables inthecurrent database.
: Shows the structureof atable.
: Renames atable.
: Modifies a table structure(e.g., add, dropcolumns).
: Retrieves datafroma table.
: Filters records based onacondition.
: Inserts newrecords into atable.
:Modifiesexisting records inatable.

Output :-

17. Queries using ORDERBY, GROUPBY, HAVING.


Ans –
Queryusing [order by]

Output:-
Queries using[group by]

Output :-

Queries using [having ]

Output :-

Querywith ORDERBY, GROUP BY, and HAVINGCombined

Output:-
18. Queries forAggregatefunctions-SUM( ), AVG(
),MIN(), MAX(), COUNT(). Ans –

(i) - Returns the sumof anumeric column

Output :-

(ii) - Returns the average valueof a numeric column.

Output :-

(iii) -Returns theminimumvalueof a column.

Output :-
(iv) -Returns themaximumvalueof a column.

Output :-

(v) - Returns the number ofrows that match aspecified


condition.

Output:-

(vi) Combinationof Aggregate Functions

Output :-
19. WAP toconnectPython with MySQL using database
connectivityandperform thefollowing operation on
dataindatabase: Createa tableindatabase.

Output :-

If thetablealreadyexists

20. WAPtoconnect Python with MySQL using


databaseconnectivityand perform thefollowing operation on
dataindatabase: Insertrecord inthe table.
Output:-

You might also like