Prepare effectively for your CBSE Class 12 Computer Science (Code 083) practical exam with our collection of Solved Practical Questions. These questions are based on the latest CBSE syllabus and cover key practical concepts such as Python programming, file handling, database management using SQL, and data structures. Each question is solved with step-by-step explanations and correct output, helping students understand the logic, structure, and expected responses. This resource is ideal for last-minute revision, class 12 CS lab file preparation, and boosting confidence before the practical assessment. Download the PDF and practice with real exam-oriented solutions to score well in your Computer Science Practical Exam.
Class 12 CS Python Practical File Programs
- Write a program that counts vowels, consonents, uppercase and lowercase characters in a file.
- Write a program to create a csv file by adding user id and password. It should also allow user to read and search the password for a user ID.
- Write a program that takes a year as an input from the user and checks whether the given year is a leap year or not.
- Write a program that accepts a digit as an input from the user. If the digit is a positive number (1-9), then display it in words; otherwise, display the message, “Error: A positive digit is expected and less than 10”.
- Write a program to accept a positive integer (n) and a floating point number (x) print sum of the following series:
x/1!+x2/2!+x3/3!+…+xn/n!
The program should keep adding the terms until the absolute difference between the two consecutive terms becomes less than 0.001. - Write a program to accept a decimal number and display its binary equivalent.
- Write a program to accept a positive integer (n) and a floating point number (x) print sum append: (Assume n<=10.)
x/1!+x2/2!+x3/3!+…+xn/n! - Write a program that reads the test file myFile.txt and counts the number of words that end with a period (‘.’).
- Write a program that removes all the lines that contain the character ‘a’ from a text file and writes it to another file.
- A binary file stores data of items in the form of dictionary objects as shown below:
Data = {ItemCode:[name,price]}
Write a menu driven program to add and display data to the binary file. - Write a program that accepts a string, and forms a new string that contains only three lettered words, with space between each word. Display both strings.
- Write a program to accept two numbers and print all prime numbers between those two numbers.
- Write a function that reads a csv file, userData.csv, that stores user id and password of students in the form of list objects. The functions should display only those records whose user id ends with the digit.
- Write a program that create sub binary file with name and rollno. It should also allow you to search for a given roll number and display the name; if not found, display the appropriate message.
- Write a function in Python that takes a list as an argument and display the square of even numbers and square roots of odd numbers separately. For example, if the list is.
L=[4,49,10,2,25]
The output should be:25 - Write a program to implement a stack using list7
- Write a program that accepts 10 numbers and adds them to a list. Thereafter, it displays the following menu:
1. Sort in ascending order
2. Sort in descending order
3. Largest number
4. Smallest number
5. Exit - Write a program that accept three colours from the user. If the user enters orange, red and green, respectively the message “Indian Flag” is displayed, otherwise, the message “ExamsMantra” is displayed.
- Write a program to check whether a number is palindrome or not16
- Write a program that reads a text file line by line and displays each words separated by a #.
- Write a program to accept a number and print sum of following series.
- Write a program that accept a number and displays sum of squares of all even numbers till that number.
- Write a random number generator that generates a random number between 1 and 6.
- Write a menu driven program to save, display and search records using a csv file, furniture.csv that uses a list object to store following data:
furnitureId int
fName string
price float
The program should also have an option to search for a record based on furnitureId. - Write a program to create a binary file with rollno, name and marks. It should also allow you to input a roll number and update the marks.
- Write a program to accept a string and output a tuple comprising the length of each word of the string. Finally, the program should display the tuple elements in ascending order. For example, if the string entered by the user is ‘Hello what do you want from me today’, then the program should produce the following output:
(5 4 2 3 4 4 2 5)
2 2 3 4 4 4 5 5. - Write a user defined function that except a character as an argument, and returns 0 if it is a digit, 1 if it is an alphabet and 2 if it is a special character. Display appropriate message according to the values return by the function.
- Write a program that accepts a number, n and displays the following pattern.
*
**
***
****
*****