CS PRACTICAL FILE FINAL 2024 - Removed
CS PRACTICAL FILE FINAL 2024 - Removed
PRESENTED BY:
REGISTRATION NO :
CLASS : SEC:
CERTIFICATE
Master / Miss.
Date:
EXTERNAL EXAMINER
ACKNOWLEDGMENT
who gave this wonderful opportunity and also for his valuable
successfully.
Table of Contents
S.No Date Content Pg.No Sign
1 24-06-24 Creating a menu driven program to perform arithmetic 3
operations.
2 24-06-24 Creating a python program to display Fibonacci series 5
3 01-07-24 Creating a menu driven program to find factorial and sum of list 7
of numbers using function.
4 01-07-24 Creating a python program to implement returning value(s) 9
from function.
5 08-07-24 Creating a python program to implement mathematical 10
functions.
6 08-07-24 Creating a python program to generate random number between 11
1 to 6
7 15-07-24 Creating a python program to read a text file line by line and 12
display each word separated by '#'.
8 15-07-24 Creating a python program to read a text file and display the 13
number of vowels/consonants/lower case/ upper case
characters.
9 22-07-24 Creating python program to display short words from a text file 15
10 22-07-24 Creating a python program to copy particular lines of a text file 16
into another text file.
11 28-07-24 Creating a python program to create and search records in 17
binary file.
12 28-07-24 Creating a python program to create and update/modify records 19
in binary file.
13 05-08-24 Creating a python program to create and search employee’s 21
record in csv file
14 05-08-24 Creating a python program to implement stack operations 23
(List).
15 12-08-24 Creating a python program to implement stack operations 26
(Dictionary).
16 12-08-24 Creating a python program to integrate MYSQL with Python 28
(Creating database and table)
17 02-09-24 Creating a python program to integrate MYSQL with Python 30
(Inserting records and displaying records)
18 02-09-24 Creating a python program to integrate MYSQL with Python 32
(Searching and displaying records)
19 09-09-24 Creating a python program to integrate MYSQL with Python 33
(Updating records)
20 09-09-24 SQL COMMANDS EXERCISE – 1 35
21 14-10-24 SQL COMMANDS EXERCISE – 2 36
22 14-10-24 SQL COMMANDS EXERCISE – 3 38
23 21-10-24 SQL COMMANDS EXERCISE – 4 40
24 21-10-24 SQL COMMANDS EXERCISE – 5 42
EX.NO : 1
DATE: 24-06-2024
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
3
SAMPLE OUTPUT:
***************************************************************************************
4
************************************************************************************************
5
EX.NO: 2
DATE: 24-06-2024
AIM:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
6
SAMPLE OUTPUT:
*****************************************************************************************
7
EX.NO: 3
DATE: 01-07-2024
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.
8
SAMPLE OUTPUT:
************************************************************************************************
9
EX.NO: 4
DATE: 01-07-2024
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:
**********************************************************************************
10
EX.NO: 5
DATE: 01-07-2024
AIM:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
***************************************************************************
11
EX.NO: 6
DATE: 08-07-2024
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
**********************************************************************************
12
EX.NO: 7
DATE: 15-07-2024
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:
13
EX.NO: 8
DATE: 15-07-2024 14
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.
SAMPLE OUTPUT:
Story.txt:
***************************************************************************************
15
EX.NO: 9
DATE: 22-07-2024
AIM:
To Write a method Disp() in Python, to read the lines from poem.txt and display those
Source Code:
Result:
Thus, the above Python program has been executed and the output is verified successfully.
Sample Output:
Poem.txt:
**********************************************************************************
16
EX.NO: 10
DATE: 22-07-2024
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:
New.txt:
*****************************************************************************************
17
EX.NO: 11
DATE: 28-07-2024
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.
18
SAMPLE OUPUT:
*******************************************************************************************
19
EX.NO: 12
DATE: 28-07-2024
AIM:
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.
20
SAMPLE OUTPUT:
PYTHON PROGRAM EXECUTED OUTPUT:
**********************************************************************************
21
EX.NO: 13
DATE: 05-08-2024
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
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
22
SAMPLE OUTPUT:
******************************************************************************
23
EX.NO: 14
DATE: 05-08-2024
following operations:
(i) To Push an object containing Doc_ID and Doc_name of doctors who specialize
in "ENT" to the stack.
(ii) To Pop the objects from the stack and display them.
(iii) To display the elements of the stack (after performing PUSH or POP)
SOURCE CODE:
24
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
********************************************************************
25
SAMPLE OUTPUT:
26
****************************************************************************************
27
EX.NO: 15
DATE: 12-08-2024
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:
28
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
*********************************************************************************
29
Sample Output:
********************************************************************
30
EX.NO: 16
DATE: 12-08-2024
AIM:
To write a Python Program to integrate MYSQL with Python to create Database and Table
to store the details of employees.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
31
Sample Output:
*******************************************************************************************************
32
EX.NO: 17
DATE: 02-09-2024
AIM:
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
33
SAMPLE OUTPUT:
******************************************************************************************************************************************************************************
34
EX.NO: 18
DATE: 02-09-2024
To write a Python Program to integrate MYSQL with Python to search an Employee using
EMPID and display the record if present in already existing table EMP, if not display the
appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
35
EX.NO: 19
DATE: 09-09-2024
(UPDATING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python to search an Employee using
EMPID and update the Salary of an employee if present in already existing table EMP,
if not display the appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
36
SAMPLE OUTPUT:
***************************************************************************************************************************** *********************
37
SQL COMMANDS EXERCISE - 1
Ex.No: 20
DATE: 09-09-2024
AIM:
To write Queries for the following Questions based on the given table:
USE STUDENTS;
SHOW DATABASES;
(e) Write a Query to List all the tables that exists in the current database.
SHOW TABLES;
Output:
38
SQL COMMANDS EXERCISE - 2
Ex.No: 21
DATE: 14-10-2024
AIM:
To write Queries for the following Questions based on the given table:
(a) Write a Query to insert all the rows of above table into Info table.
(b) Write a Query to display all the details of the Employees from the above table 'STU'.
Output:
39
(c) Write a query to Rollno, Name and Department of the students from STU table.
Output:
Output:
********************************************************************************************
40
Ex.No: 22
DATE: 14-10-2024
SQL COMMANDS EXERCISE - 3
AIM:
To write Queries for the following Questions based on the given table:
Output:
(b) Write a Query to list name of the students whose ages are between 18 to 20.
Output:
41
(c) Write a Query to display the name of the students whose name is starting with 'A'.
Output:
(d) Write a query to list the names of those students whose name have second alphabet 'n' in their
names.
Output:
**********************************************************************************************************
42
Ex.No: 23
SQL COMMANDS EXERCISE - 4
DATE: 21-10-2024
AIM:
To write Queries for the following Questions based on the given table:
(b) Write a Query to change the fess of Student to 170 whose Roll number is 1, if the existing fess
is less than 130.
Output(After Update):
43
(c) Write a Query to add a new column Area of type varchar in table STU.
Output:
(d) Write a Query to Display Name of all students whose Area Contains NULL.
Output:
(e) Write a Query to delete Area Column from the table STU.
Output:
Output:
*******************************************************************************************
44
Ex.No: 24
DATE: 21-10-2024 SQL COMMANDS EXERCISE - 5
AIM:
To write Queries for the following Questions based on the given table:
TABLE: UNIFORM
TABLE: COST
(a) To Display the average price of all the Uniform of Raymond Company from table COST.
Output:
(b) To display details of all the Uniform in the Uniform table in descending order of Stock date.
Output:
45
(c) To Display max price and min price of each company.
Output:
(d) To display the company where the number of uniforms size is more than 2.
Output:
(e) To display the Ucode, Uname, Ucolor, Size and Company of tables uniform and cost.
Output:
********************************************************************************** *******
46