Loading the virtual lab…
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.
Use this to prepare before your lab period. The board practical exam is done on real apparatus.
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.
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).
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).
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).
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).
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).
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.
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.
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).
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.
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).