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

Practical File 2023-24

Grade 12 CS practical file 2023-24

Uploaded by

uma
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)
14 views23 pages

Practical File 2023-24

Grade 12 CS practical file 2023-24

Uploaded by

uma
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

Program 1: Write a program to find the factorial of the entered number.

Source Code:
Program 2:Write a Python Program to display Fibonacci Series upto ‘n’ numbers

Source Code:
Program 3: Write a Python Program to check whether the inputted number is Perfect
number or not

Source Code:
Program 4: Write a Python program to check whether the given number is armstrong
number or not

Source Code:
Program 5: Write a python program to input any two
tuples and swap their values.

Source code:
Program 6: Write a python program to generate random numbers
between 1 to 6 to stimulate the dice.

Source code:
Program 7: create a program using user defined function named
login that accepts userid and password as parameters
(login(uid,pswd))that displays a message account blocked in case of
three wrong attempts. The login is successful if the user enters user
ID as "ADMIN" and password as"Rims123". On successful login,
display a message login successful.
Source code:
Output 1:
Output 2:

Program 8) Read text file line by line and display each word separated by ‘#’

Note: content of quotes.txt


THE SECRET OF YOUR FUTURE IS HIDDEN IN YOUR DAILY ROUTINE.
IF YOU ARE NOT WILLING OT LEARN, NO ONE CAN HELP YOU.
IF YOU ARE DETERMINED TO LEARN, NO ONE CAN STOP YOU.
Output

THE#SECRET#OF#YOUR#FUTURE#IS#HIDDEN#IN#YOUR#DAILY#ROUTINE.#
IF#YOU#ARE#NOT#WILLING#TO#LEARN,#NO#ONE#CAN#HELP#YOU.#
IF#YOU#ARE#DETERMINED#TO#LEARN,#NO#ONE#CAN#STOP#YOU.#

Program 9:Read a text file and display the number of vowels/ consonants/ uppercase/
lowercase characters in the file
Note: Content of myfile.txt
12 Computer Science
Varam Kadavu
Varam PO
kannur
KERALA 670594

Output:
vowels= 19
Consonants = 26
Uppercase= 13
Lowercase= 32

Program 10: Remove all the lines that contain the character ‘a’ in a file and write it to another
files
Note: Content of SampleOld.txt:
Start…
First Line
Second Line
Second Last Line
End..
Source Code:

Output
Changed content of SampleOld.txt is:
First Line
Second Line
End..

Content of SampleNew.txt is:


Start…
Second Last Line

Program 11: Create


a binary file with name and roll number. Search for a
given roll number and display the name; if not found display appropriate
message
Output:
Enter Your Choice:
1.Add Records
2.Display Records
3.Search Records (By Roll No)
0.Exit (Enter 0 to exit)
Enter Your Choice: 1
How many records you want to create :2
Enter Roll No: 1
Enter Name: Abhijith
Enter Roll No: 2
Enter Name: Rohith
Enter Your Choice :
1.Add Records
2.Display Records
3.Search Records (By Roll No)
0.Exit (Enter 0 to exit)
Enter Your Choice: 2
-------DISPLAY STUDENTS DETAILS--------
Roll No. Name
1 Abhijith
2 Rohith
Enter Your Choice :
1.Add Records
2.Display Records
3.Search Records (By Roll No)
0.Exit (Enter 0 to exit)
Enter Your Choice: 3
Enter a Rollno to be Search: 2
Roll NO: 2
Name: Rohith
Enter Your Choice are:
1.Add Records
2.Display Records
3.Search Records (By Roll No)
0.Exit (Enter 0 to exit)
Enter Your Choice: 0
Program 12: Create a binary file with roll number , name and
marks. Input a roll number and update the marks.
Program 13: Write a menu drive program to perform following operations into
sports.csv file

1. Add record
2. Display records
3. Search record
4. Exit

Source code
Program 14: Write a menu based program to Maintaining Book details like bcode, btitle
and price using stacks in python.

Source Code

You might also like