ByteBoard Notes Lab Manual Notes

Lab Manual for Computer Science and Informatics Practices

All 130 programs for your CBSE practical file (2026-27 syllabus), laid out the way a file page is: aim, algorithm, program, output and result. Every output came from actually running the code.

Select a subject

Its index will appear below.

Your practical-file index

Open any experiment. Page numbers follow the file: each experiment takes one spread, output on the left page, program on the right.

Index

Computer Science (083) · Class XI · Session 2026-27

Your report file needs at least 20 Python programs. Class XI has no user-defined functions and no files, so none of these programs use them.

30 marks: Lab test 12 · Report file 7 · Viva 3 · Project 8. ★ marks a program from CBSE's own suggested list.

Python programs · 27
No.ExperimentPageDone✓
01★Input a welcome message and display itPython1–2
02★Input two numbers and display the larger and the smaller numberPython3–4
03★Input three numbers and display the largest and the smallest numberPython5–6
04Find the absolute value of a number without using abs()Python7–8
05Input three numbers and display them in ascending order without using sort()Python9–10
06Input a number and check whether it is divisible by 3, by 5, by both, or by neitherPython11–12
07Input percentage marks and display the grade using the CBSE grading scalePython13–14
08★Generate star, number and letter patterns using nested loopsPython15–16
09★Input x and n and print the sum of four seriesPython17–18
10Find the factorial of a positive number using a while loopPython19–20
11★Determine whether a number is a perfect number, an Armstrong number or a palindromePython21–22
12★Input a number and check whether it is a prime or a composite numberPython23–24
13★Display the terms of a Fibonacci seriesPython25–26
14★Compute the greatest common divisor and least common multiple of two integersPython27–28
15★Count and display the number of vowels, consonants, uppercase and lowercase characters in a stringPython29–30
16★Input a string and check whether it is a palindrome; convert the case of its charactersPython31–32
17Input a sentence, count its words and display the longest wordPython33–34
18★Find the largest and smallest number in a list and in a tuplePython35–36
19Find the mean of the numbers in a list in three waysPython37–38
20★Input a list of numbers and swap elements at even locations with elements at odd locationsPython39–40
21★Input a list or tuple of elements and search for a given elementPython41–42
22Count the frequency of each element in a listPython43–44
23Count how many times each character appears in a string using a dictionaryPython45–46
24Create a dictionary of employee names and salaries and access themPython47–48
25★Create a dictionary of roll number, name and marks and display students who scored above 75Python49–50
26Use the math module to find the area and circumference of a circle, a hypotenuse, and the ceiling and floor of a numberPython51–52
27Generate random numbers and find their mean, median and modePython53–54
★ from CBSE's suggested practical list✓ done (kept in this browser)

Index

Computer Science (083) · Class XII · Session 2026-27

Your report file needs at least 15 Python programs, 5 SQL query sets and 4 Python–SQL connectivity programs.

30 marks: Lab test 12 · Report file 7 · Project 8 · Viva 3. ★ marks a program from CBSE's own suggested list.

Python programs · 18
No.ExperimentPageDone✓
01Display all prime numbers in a range using a function is_prime()Python1–2
02Compute simple interest using a function with default parametersPython3–4
03Write a function that returns the maximum, minimum and mean of a listPython5–6
04Show the difference between local and global variablesPython7–8
05Divide two numbers and handle errors with try, except and finallyPython9–10
06★Read a text file line by line and display each word separated by #Python11–12
07★Read a text file and display the number of vowels, consonants, uppercase and lowercase charactersPython13–14
08★Remove all lines that contain the character 'a' from a file and write them to another filePython15–16
09Count the words "the" and "this" in a text file and display the lines that begin with TPython17–18
10Show how seek() and tell() move and report the file pointerPython19–20
11★Create a binary file with name and roll number and search for a roll numberPython21–22
12★Create a binary file with roll number, name and marks and update the marks of a studentPython23–24
13Append records to a binary file and display students who scored above 75Python25–26
14★Write a random number generator that simulates a dicePython27–28
15★Write a Python program to implement a stack using a listPython29–30
16Push the names of students who scored above 75 from a dictionary onto a stack and pop themPython31–32
17★Create a CSV file of user-ids and passwords and search for the password of a given user-idPython33–34
18Write employee records to a CSV file and display employees earning above 50000Python35–36
SQL query sets · 6
No.ExperimentPageDone✓
19★SQL Set 1: create a STUDENT table and use ALTER, UPDATE, ORDER BY, DELETE and GROUP BYSQL37–38
20SQL Set 2: query an EMPLOYEE table with WHERE, DISTINCT, IN, BETWEEN, LIKE and IS NULLSQL39–40
21SQL Set 3: aggregate functions with GROUP BY and HAVINGSQL41–42
22SQL Set 4: cartesian product, equi-join and natural join on EMPLOYEE and DEPARTMENTSQL43–44
23SQL Set 5: SHOW, DESCRIBE, adding and removing a primary key, DROP TABLE and DROP DATABASESQL45–46
24SQL Set 6: join ITEM and SUPPLIER with GROUP BY and ORDER BYSQL47–48
Python–SQL connectivity · 5
No.ExperimentPageDone✓
25★Connect to MySQL, create a table and insert records entered by the userSQL49–50
26Display records with fetchone() and fetchall() and count them with rowcountSQL51–52
27Update a record in a MySQL table from Python using format()SQL53–54
28Delete a record from a MySQL table from PythonSQL55–56
29Write a menu-driven program to insert, display, search, update and delete student records in MySQLSQL57–58
★ from CBSE's suggested practical list✓ done (kept in this browser)

Index

Informatics Practices (065) · Class XI · Session 2026-27

Your practical file needs at least 14 Python programs and 14 SQL queries. Class XI IP has no user-defined functions, and its SQL stops at WHERE, BETWEEN and IS NULL; ORDER BY, LIKE and aggregate functions come in Class XII.

30 marks: Python 11 · MySQL 7 · Practical file 7 · Viva 5. ★ marks a program from CBSE's own suggested list.

Python programs · 20
No.ExperimentPageDone✓
01★To find the average and grade for given marksPython1–2
02★To find the sale price of an item with given cost and discount (%)Python3–4
03★To calculate the perimeter or circumference and area of a triangle, rectangle, square and circlePython5–6
04★To calculate simple and compound interestPython7–8
05★To calculate profit or loss for given cost and selling pricePython9–10
06★To calculate EMI for amount, period and interestPython11–12
07★To calculate tax: GST on a bill and income tax using slabsPython13–14
08★To find the largest and smallest numbers in a listPython15–16
09★To find the third largest and third smallest number in a listPython17–18
10★To find the sum of squares of the first 100 natural numbersPython19–20
11★To print the first n multiples of a given numberPython21–22
12★To count the number of vowels in a user-entered stringPython23–24
13★To print the words starting with a given letter in a user-entered stringPython25–26
14★To print the number of occurrences of a given letter in each string of a listPython27–28
15★Create a dictionary to store names of states and their capitalsPython29–30
16★Create a dictionary of students to store names and marks obtained in 5 subjectsPython31–32
17★To print the highest and lowest values in a dictionaryPython33–34
18Perform list operations using a menu: append, insert, remove, pop, sort, reverse, count and indexPython35–36
19Update, delete and clear dictionary entries and display keys, values and itemsPython37–38
20Create one-dimensional and two-dimensional NumPy arrays from listsPandas39–40
SQL queries · 16
No.ExperimentPageDone✓
21★To create a databaseSQL41–42
22★To create a student table with student id, class, section, gender, name, dob and marksSQL43–44
23★To insert the details of at least 10 students in the student tableSQL45–46
24★To display the entire content of the tableSQL47–48
25★To display Rno, Name and Marks of students scoring more than 50SQL49–50
26★To display Rno, Name and DOB of students born between two datesSQL51–52
27To display students of class XI and section ASQL53–54
28To display students who are in section B or scored above 80SQL55–56
29To display girls who scored 75 or moreSQL57–58
30To display students who were not born in 2009SQL59–60
31To display students whose marks have not been enteredSQL61–62
32To display students whose marks have been enteredSQL63–64
33To increase the marks of all section B students by 5SQL65–66
34To delete the record of a student with a given student idSQL67–68
35To add a column to the table and then drop itSQL69–70
36To drop the table and the databaseSQL71–72
★ from CBSE's suggested practical list✓ done (kept in this browser)

Index

Informatics Practices (065) · Class XII · Session 2026-27

Your practical file needs at least 15 Pandas programs, 4 Matplotlib programs and 15 SQL queries. Every program uses only the Pandas and Matplotlib features in the Class XII IP syllabus (no groupby, iloc or statistics methods).

30 marks: Pandas + plots 8 · SQL 7 · Practical file 5 · Project 5 · Viva 5. ★ marks a program from CBSE's own suggested list.

Pandas programs · 17
No.ExperimentPageDone✓
01★Create a Pandas Series from a dictionary and from an ndarrayPandas1–2
02Create a Series from a scalar value with a custom indexPandas3–4
03Perform mathematical operations on two SeriesPandas5–6
04Display the first and last elements of a Series with head() and tail()Pandas7–8
05Select, index and slice a Series by label and by positionPandas9–10
06Create a Series of monthly sales, increase every value by 10% and slice the last quarterPandas11–12
07Create a DataFrame from a dictionary of SeriesPandas13–14
08Create a DataFrame from a list of dictionariesPandas15–16
09★Create a DataFrame for examination results and display its row labels, column labels, data types and dimensionsPandas17–18
10Add, rename and delete rows and columns of a DataFramePandas19–20
11Select rows and columns of a DataFrame by label using loc[]Pandas21–22
12Use Boolean indexing to filter rows of a DataFramePandas23–24
13Iterate over a DataFrame with iterrows() and items()Pandas25–26
14Display the first and last rows of a DataFrame with head() and tail()Pandas27–28
15Add Total and Percentage columns calculated from existing columnsPandas29–30
16From a quarterly sales DataFrame, display a chosen category and delete rows below a given expenditurePandas31–32
17★Import data from a CSV file into a DataFrame and export a DataFrame to a CSV filePandas33–34
Matplotlib programs · 5
No.ExperimentPageDone✓
18★Given school result data, analyse subject-wise performance and plot itPandas35–36
19★Plot a chart with a title and legend from a DataFramePandas37–38
20Plot the monthly sales of two products on one line chart and save it as a PNG filePandas39–40
21Plot a histogram of the marks of a classPandas41–42
22★Take data from an open source such as data.gov.in, summarise it and plot itPandas43–44
SQL queries · 16
No.ExperimentPageDone✓
23★Create a student table with the student id, name and marks as attributes where the student id is the primary keySQL45–46
24★Insert the details of a new student in the student tableSQL47–48
25★Delete the details of a student in the student tableSQL49–50
26★Use the select command to get the details of the students with marks more than 80SQL51–52
27★Find the min, max, sum and average of the marks in a student marks tableSQL53–54
28★Find the total number of customers from each country using GROUP BYSQL55–56
29★Display the (student ID, marks) table in descending order of the marksSQL57–58
30Use the math functions POWER(), ROUND() and MOD()SQL59–60
31Use the text functions UPPER(), LOWER() and LENGTH()SQL61–62
32Use the text functions SUBSTR()/MID(), LEFT(), RIGHT() and INSTR()SQL63–64
33Remove spaces from a string with LTRIM(), RTRIM() and TRIM()SQL65–66
34Use the date functions NOW(), DATE(), MONTH(), MONTHNAME(), YEAR(), DAY() and DAYNAME()SQL67–68
35Compare COUNT(*) and COUNT(column) on a column with NULL valuesSQL69–70
36Display classes whose average marks are above 70 using GROUP BY and HAVINGSQL71–72
37Display employee names with their department names from two tables using an equi-joinSQL73–74
38Display the total sales of each salesperson from two tables, highest firstSQL75–76
★ from CBSE's suggested practical list✓ done (kept in this browser)

How the practical is marked

Lab test: logic is 60%, not 100%

60 logic
20
20

In Computer Science the other 40% is documentation (comments, a clear header) and code quality (names, indentation, prompts). A working program with no comments loses marks.

What every file page needs

  1. Experiment number, date and aim
  2. Program, written on the ruled page
  3. Output, on the facing blank page
  4. Your teacher's signature

Viva: know why, not only how

Every experiment ends with viva questions from its own topic. Answer them aloud before you open the answer.

! The file is checked against the CBSE minimum count for your paper. A short file loses marks even if each program is right.