TN Online TestSamacheer Kalvi practice

12th Computer Science Practicals: Virtual Lab

All 10 programs from the Tamil Nadu State Board 12th Computer Science practical handbook. Read the code, give your own input, run it and see the output; type real SQL queries in a MySQL console that ticks off each task.

🧪 10 experiments 🌐 Tamil & English 🎤 Viva practice 💡 Tips on every control

Use this to prepare before your lab period. The board practical exam is done on real apparatus.

Loading the virtual lab…

Programs and queries: TN State Board 12th Computer Science practical handbook. Output is produced by this page, not by a real Python or MySQL installation.

Computer Science

Experiments in this lab

1PY1: (a) Factorial using a for loop, (b) Sum of the series

Aim: (a) Write a program to calculate the factorial of a given number using a for loop. (b) Write a program to sum the series 1¹/1 + 2²/2 + 3³/3 + … + nⁿ/n.

Apparatus: Python 3 (IDLE).

Open the PY1 Factorial & series lab →

2PY2: (a) Odd or even using a function, (b) Mirror of a string

Aim: (a) Write a program using functions to check whether a number is even or odd. (b) Write a program to create a mirror of the given string, e.g. "wel" → "lew".

Apparatus: Python 3 (IDLE).

Open the PY2 Odd/even & mirror lab →

3PY3: Generate values and remove odd numbers

Aim: Write a program to generate values from 1 to 10 and then remove all the odd numbers from the list.

Apparatus: Python 3 (IDLE).

Open the PY3 Remove odd numbers lab →

4PY4: Generate prime numbers and set operations

Aim: Write a program that generates a set of prime numbers and another set of odd numbers. Display the result of union, intersection, difference and symmetric difference.

Apparatus: Python 3 (IDLE).

Open the PY4 Primes & sets lab →

5PY5: Display string elements using a class

Aim: Write a program to accept a string and print the number of uppercase letters, lowercase letters, vowels, consonants and spaces in it, using a class.

Apparatus: Python 3 (IDLE).

Open the PY5 String using class lab →

6DB6: MySQL — Employee table

Aim: Create an Employee table with Empno, Empname, Desig, Dept, Age and Place. Enter five records; add two more; add the field date of joining; check for NULL in doj; list the employees who joined after 2018/01/01.

Apparatus: MySQL server and command-line client.

Open the DB6 MySQL Employee lab →

7DB7: MySQL — Student table

Aim: Create a Student table (Reg_No, Sname, Age, Dept, Class) and enter the given data. Then list CSE students; students aged 20 and more in ME; students department-wise; change class ME2 to ME1; check that Reg_No is unique.

Apparatus: MySQL server and command-line client.

Open the DB7 MySQL Student lab →

8PY8: Python with CSV

Aim: Write a program to get 10 players’ names and scores, write them into a CSV file, accept a player name, read the CSV file and display the name and score. If the player is not found, give a message.

Apparatus: Python 3 (IDLE).

Open the PY8 Python with CSV lab →

9PY9: Python with SQL (sqlite3)

Aim: Create an SQL table using Python, accept 10 names and ages, sort in descending order of age and display.

Apparatus: Python 3 with the built-in sqlite3 module.

Open the PY9 Python with SQL lab →

10PY10: Python graphics with pip — pie chart

Aim: Write a program to get five marks using a list and display the marks in a pie chart.

Apparatus: Python 3 with matplotlib (installed using pip).

Open the PY10 Pie chart (pip) lab →