Sample Record XII
Sample Record XII
THODUPUZHA
Aff. No. 930753
COMPUTERSCIENCE
2024-2025
1
CO-OPERATIVE PUBLIC SCHOOL
THODUPUZHA
PRACTICALRECORDBOOK
XII
COMPUTER SCIENCE
2024-
2025
Certified that this was the record of Bonafide practical work carried
out by ............................................................................................................
Reg. No. ........................................... of Class XII in this school during
the year2024-
2025.
Date:
2
INDEX
SI PG
NO DATE NAME OF THE EXPERIMENT NO
3
1. PRIME NUMBER GENERATOR
AIM: To generate all prime number between the range n1 and n2
(inputted by the user)
Source Code:
Output:
SCREEN SHOT
4
2. SECOND LARGEST ELEMNT
AIM: To find the second largest elemnt in a list
Source Code:
Output:
SCREEN SHOT
5
3. FIBONACCI SERIES
Source Code:
Output:
SCREEN SHOT
6
4. SUM OF SERIES.
Source Code:
s=0
f=1
for i in range(1,n+1):
f=f*i
p=x**i
s=s+p/f
print(s)
Output:
7
SCREEN SHOT
AIM: To input a list and a numeric value and shift the element in the
list to left by the numeric value
Source Code:
for i in range(k):
p=L[-1]
8
for j in range(len(L)):
L[j-1]=L[j]
L[-2]=p
Output :
SCREEN SHOT
9
6. STACK OPERATIONS
AIM: A ,menu driven program to insert ,delete and display on a stack
Source code:
10
Output:
SCREEN SHOT
Source code:
def PUSH(stk,item):
stk.append(item)
TOP=len(stk)-1
def POP(stk):
item=stk.pop()
11
return item
stk=[]
TOP=None
for i in string:
PUSH(stk,i)
while len(stk)!=0:
item=POP(stk)
print(item,end='')
OUTPUT
SCREEN SHOT
12
8. Managing Directory Information
Aim: To manage the linear stack called directory with the following
information: city name and pin code
Source code:
13
OUTPUT
SCREEN SHOT
9. BUBBLE SORT
Source code:
L=eval(input("enter a list"))
n=len(L)
for i in range(n-1):
for j in range(n-i-1):
if L[j]>L[j+1]:
L[j],L[j+1]=L[j+1],L[j]
14
OUTPUT
SCREEN SHOT
15
10. CONVERTING 1ST LETTER TO UPPER CASE
Source Code:
x=input("enter a sentence")
y=x.split()
z=[]
for i in y:
a=i[0].upper()+i[1: ]
z.append(a)
b=''.join(z)
print(b)
16
Output:
SCREEN SHOT
Source Code:
17
Output:
SCREEN SHOT
12.TEXT FILE 1
AIM: To read the contents of text file and display words having
exactly four characters.
Source Code:
18
Output:
SCREEN SHOT
Source Code:
19
Output:
SCREEN SHOT
AIM: To remove all lines that contain the character ‘a’ in a file and
write it to another file.
Source Code:
20
Output:
SCREEN SHOT
Source Code:
21
Output:
SCREEN SHOT
16.CSV FILE
Source Code:
22
Output:
SCREEN SHOT
17.DATABASE MANAGEMENT
1. Database creation
Command:
create database database ename;
Output :
23
SCREEN SHOT
2. Open database
Command :
use databasename;
Output:
SCREEN SHOT
3. Table creation
Command:
<column2><data type>[(<size>)……]);
Output:
SCREEN SHOT
output:
24
SCREEN SHOT
5. Retrieve data from table
Command:
Select column name from table name;
Output:
SCREEN SHOT
6. Alter tables structure (add column)
Command:
Alter table <table name> ADD <column name><data
type><size> [<constraint name >];
SCREEN SHOT
Output:
SCREEN SHOT
8. Alter table structure(change column name)
25
Command:
Alter table change [column] old_col_name
column_defenition;
Output:
SCREEN SHOT
9. Modify Data
Command:
Update table name set column name=value where condition;
Output:
SCREEN SHOT
SCREEN SHOT
26
11. Order By
Command:
Select column list from tablename order by column name;
Output:
SCREEN SHOT
12. Group By
Command:
Select column list from table name group by column name;
Output:
SCREEN SHOT
A. Create a table
27
Output:
SCREEN SHOT
Output:
SCREEN SHOT
Output:
SCREEN SHOT
28
Output:
SCREEN SHOT
29
Output:
SCREEN SHOT
30