Kvgclass 12 Cs Practical Exercises 2024-2025[1]
Kvgclass 12 Cs Practical Exercises 2024-2025[1]
Kvgclass 12 Cs Practical Exercises 2024-2025[1]
GOALPARA
COMPUTER SCIENCE
PRACTICAL PROGRAMS
CLASS – XII
[2024-2025]
1
TABLE OF CONTENTS
2
EX.NO: 1
DATE:
CREATING A MENU DRIVEN PROGRAM TO PERFORM ARITHMETIC
OPERATIONS
AIM:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
3
SAMPLE OUTPUT:
***************************************************************************************
4
EX.NO: 2
DATE:
CREATING A PYTHON PROGRAM TO DISPLAY FIBONACCI SERIES
AIM:
To write a Python Program to display Fibonacci Series up to ‘n’ numbers.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
5
SAMPLE OUTPUT:
Python Executed Program Output:
*****************************************************************************************
6
EX.NO: 3
DATE:
AIM:
To write a menu driven Python Program to find Factorial and sum of list of numbers
using function.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
7
SAMPLE OUTPUT:
Python Executed Program Output:
************************************************************************************************
8
EX.NO: 4
DATE:
AIM:
To Write a Python program to define the function Check(no1,no2) that take two numbers and
Returns the number that has minimum ones digit.
Source Code:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
**********************************************************************************
9
EX.NO: 5
DATE:
AIM:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Executed Program Output:
***************************************************************************
10
EX.NO: 6
DATE:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
**********************************************************************************
11
EX.NO: 7
DATE:
AIM:
To write a Python Program to Read a text file "Story.txt" line by line and display
each word separated by '#'.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Story.txt:
12
EX.NO: 8
DATE:
To write a Python Program to read a text file "Story.txt" and displays the number of
Vowels/ Consonants/ Lowercase / Uppercase/characters in the file.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
13
SAMPLE OUTPUT:
Story.txt:
***************************************************************************************
14
EX.NO: 9
DATE:
AIM:
To Write a method Disp() in Python, to read the lines from poem.txt and display those
words which are less than 5 characters.
Source Code:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
Poem.txt:
**********************************************************************************
15
EX.NO: 10
DATE:
To write a python program to read lines from a text file "Sample.txt" and copy those lines
into another file which are starting with an alphabet 'a' or 'A'.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Executed Program output:
Sample.txt:
New.txt:
*****************************************************************************************
16
EX.NO: 11
DATE:
AIM:
To write a Python Program to Create a binary file with roll number and name.
Search for a given roll number and display the name, if not found display appropriate
message.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
17
SAMPLE OUPUT:
*******************************************************************************************
18
EX.NO: 12
DATE:
To write a Python Program to Create a binary file with roll number, name, mark
and update/modify the mark for a given roll number.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
19
SAMPLE OUTPUT:
PYTHON PROGRAM EXECUTED OUTPUT:
**********************************************************************************
20
EX.NO: 13
DATE:
AIM:
To write a Python program Create a CSV file to store Empno, Name, Salary and search any Empno
and display Name, Salary and if not found display appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
21
SAMPLE OUTPUT:
******************************************************************************
22
EX.NO: 14
DATE:
AIM:
To write a Python program to implement Stack using a list data-structure, to perform
(i) To Push an object containing Doc_ID and Doc_name of doctors who specialize
in "ENT" to the stack.
(ii) (ii) To Pop the objects from the stack and display them.
(iii)
(iv) (iii) To display the elements of the stack (after performing PUSH or POP)
SOURCE CODE:
23
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Program Executed Output:
24
****************************************************************************************
25
EX.NO: 15
DATE:
AIM:
To Write a program, with separate user-defined functions to perform the following
operations:
(i) To Create a function Push(Stk,D) Where Stack is an empty list and D is Dictionary of Items.
from this Dictionary Push the keys (name of the student) into a stack, where
the corresponding value (marks) is greater than 70.
(ii) To Create a Function Pop(Stk) , where Stk is a Stack implemented by a list of student
names. The function returns the items deleted from the stack.
(iii) To display the elements of the stack (after performing PUSH or POP).
Source Code:
26
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
*********************************************************************************
27