Class 12 Practical File

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

PRACTICAL 1

Q:Write a random number generator that generates random numbers between 1 to 6.

Source Code:

Output Screen :

LAKSHIT JAIN 1
PRACTICAL 2

Q:Write a program to calculate sum of digits of random three digit number.

Source Code:

Output Screen :

LAKSHIT JAIN 2
PRACTICAL 3

Q:Write a program to demonstrate the execution of randrange() and randint() functions.

Source Code:

Output Screen :

LAKSHIT JAIN 3
PRACTICAL 4

Q:Write a program to calculate the area of a rectangle on the basis of length and breadth
provided by the user as the arguments of the function.

Source Code:

Output Screen :

LAKSHIT JAIN 4
PRACTICAL 5

Q:Write a program to calculate arithmetic mean of a list elements passed to a function as an


argument.

Source Code:

Output Screen :

LAKSHIT JAIN 5
PRACTICAL 6

Q:Write a menu driven program to calculate area and perimeter of rectangle and area and
circumference of a circle using function and importing modules.

Source Code:

Circle

LAKSHIT JAIN 6
Rectangle:

Output Screen :

LAKSHIT JAIN 7
PRACTICAL 7
Q:Write a menu driven program to implement all basic equations of a stack.
Source Code:

Output Screen :

LAKSHIT JAIN 8
PRACTICAL 8
Q:Write a menu driven program to implement all basic operations of a queue.
Source Code:

Output Screen :

LAKSHIT JAIN 9
PRACTICAL 9

Q:WAP to calculate factorial of a number using recursion .

Source Code:

Output Screen :

LAKSHIT JAIN 10
PRACTICAL 10

Q:WAP to print Fibonacci Series using recursion

Source Code:

Output Screen :

LAKSHIT JAIN 11
PRACTICAL 11

Q:WAP to read a text file line by line and display each word separated by a #.

Source Code:

Output Screen :

LAKSHIT JAIN 12
PRACTICAL 12

Q:WAP to calculate the number of vowels in a file.

Source Code:

Output Screen :

LAKSHIT JAIN 13
PRACTICAL 13

Q:WAP to count number of words in a file.

Source Code:

Output Screen :

LAKSHIT JAIN 14
PRACTICAL 14

Q:WAP to create a binary file with roll no, name and marks . Input a roll no, and update the
marks.
Source Code:

LAKSHIT JAIN 15
Output Screen :

LAKSHIT JAIN 16
PRACTICAL 15

Q:Create a CSV file by entering user-ID and password, read and search the password for given
user-ID.

Source Code:

LAKSHIT JAIN 17
Output Screen :

CSV File:

LAKSHIT JAIN 18
PRACTICAL 16
Q: Search for any name in file and display the record number.

Source Code :

Output Screen :

LAKSHIT JAIN 19
PRACTICAL 17
Q: The program reads a file and capitalizes the first letter of every word in the file.

Source Code :

Output Screen :

LAKSHIT JAIN 20
PRACTICAL 18
Q: Update Name in Binary File.

Source Code :

Output Screen:

LAKSHIT JAIN 21

You might also like