CBSE Class 12 · Computer Science, code 083 · Notes for 2026-27

Class 12 computer science notes, short enough to finish.

These class 12 computer science notes hold the whole 083 syllabus in 17 cards. Each card has the rule, one small piece of code, the slip to avoid and three memory checks. A single honey farm runs through them all, so that the function in card 2 and the query in card 16 talk about the same hives.

Live one to one · 17 cards, 51 memory checks · every snippet run · lessons when your day allows

Start here

When a card is not enough

A note reminds; it does not teach what was never learnt. These courses do, from the start of each subject.

Ans. The short version

Class 12 computer science notes for CBSE 083 need to cover three units in 2026-27: Computational Thinking and Programming 2 (40 marks: functions, exceptions, text, binary and CSV files, stack), Computer Networks (10) and Database Management (20: relational terms, SQL, Python with MySQL). This page puts them in 17 short cards, each with the rule, a tested snippet and three memory checks, and links to a full page per chapter. Modern Age Coders turns notes into written answers in live, personalised one to one classes at your timing. A priority demo shows you how before you enrol.

Q1. What is here, and how do I use it?

Class 12 computer science notes chapter wise: the 17 cards

Read one card, cover it, say the three memory checks aloud, and write its code once without looking. That takes about ten minutes a card.

Marks by card are not published; only the unit totals are. The official list of topics is on the 083 syllabus page.

The running example

A family keeps bees. It has hives in two places, notes the honey taken, and sells it in jars. You will meet this farm as a list, a text file, a binary file, a CSV file, a stack and finally two tables.

From notes to marks, in three passes

  • Pass 1, read. Two units a week is comfortable before January.
  • Pass 2, recall. Only the memory checks. Put a dot beside each miss.
  • Pass 3, produce. Write the code of every dotted card, changed to a new story.

Copying these cards into a notebook is fine. Copying them twice is not revision; the second time, write them from memory and compare.

Unit 1. Cards 1 to 4

CBSE Class 12 computer science notes: Python, functions, exceptions

The first part of Unit 1 is the Class 11 language revised, then functions, scope and handling of errors.

1. Python revised

Rule. Strings and tuples cannot change; lists and dictionaries can. Slices stop one before the end. ** is worked from the right, then * / // %, then + -, then comparisons, then not, and, or.

Four containersone line each
hives = ["Orchard", "Canal", "Orchard"]      # list
first = ("H1", 12.5)                         # tuple
kg = {"Orchard": 21, "Canal": 13.5}          # dictionary
print(hives.count("Orchard"), hives[::-1])
print(first[0].lower() + "!", "Hill" in kg)
2 ['Orchard', 'Canal', 'Orchard']
h1! False

Slip. L.sort() returns None; sorted(L) returns a list. in on a dictionary looks at keys.

Memory check: 7 // 2 * 2.0 / "a-b".split("-") / randint or randrange 1. 6.0: the division gives 3, and the float makes the product a float. 2. ["a", "b"]. 3. randint(1, 3) can give 3; randrange(1, 3) cannot.

In full: output questions

2. Functions

Rule. Three kinds: built-in, defined in a module, user defined. Parameters are in the header, arguments in the call. Defaults are written last. return ends the function and may send back several values as a tuple.

Default parametercalled two ways
def jars(honey, size=0.5):
    """Number of full jars from honey in kg."""
    return int(honey / size)

print(jars(6))
print(jars(6, 0.75))
12
8

Slip. A function that prints gives None to the caller. If the question says return, return.

Memory check: argument / def f(a=1, b) / flow of execution 1. The value given in the call. 2. SyntaxError: the default comes before the parameter without one. 3. def is only noted; the body runs at the call, then control goes back.

In full: functions

Module functions from Class 11. math: sqrt, ceil, floor, pow, fabs, sin, cos, tan, pi, e. random: random (from 0 up to but not 1), randint, randrange. statistics: mean, median, mode. Import the module first, then write its name and a dot: math.ceil(4.1) is 5.

3. Scope

Rule. A name assigned inside a function is local to it. A name made outside is global: it can be read anywhere, but to assign it inside a function you need global.

Global totalchanged on purpose
total = 0

def add(kg):
    global total
    total = total + kg

add(4)
add(2.5)
print(total)
6.5

Slip. Without the global line this stops with UnboundLocalError. A list parameter is different: append() changes the caller's list, because nothing is assigned.

Memory check: same name inside and outside / life of a local / global or parameter 1. Two variables; inside, the local one is used. 2. From its assignment until the function returns. 3. Prefer a parameter and a return value; use global only when asked.

In full: scope traces

4. Exception handling

Rule. Risky lines go in try. A matching except runs if they fail. finally runs either way.

try, except, finallytwo calls
def per_hive(kg, hives):
    try:
        print(kg / hives, "kg each")
    except ZeroDivisionError:
        print("No hives yet")
    finally:
        print("Checked")

per_hive(21, 2)
per_hive(21, 0)
10.5 kg each
Checked
No hives yet
Checked

Slip. The lines of try after the failing one are skipped, not returned to.

Fails onName
int("ten")ValueError
"2" + 2TypeError
a name never madeNameError
index past the endIndexError
missing dictionary keyKeyError
file not thereFileNotFoundError
Memory check: try needs / uncaught error with finally / SyntaxError 1. At least one except, or a finally. 2. finally runs, then the error stops the program. 3. Found before the program runs, so try around that code cannot help.

In full: exception handling

Unit 1. Cards 5 to 9

Class 12 CS short notes: text, binary and CSV files, and the stack

The second part of Unit 1 is storing data. Three kinds of file differ in what they hold and which function reads them.

5. File basics

Rule. A relative path starts from the current folder, an absolute path from the drive or root. with open(...) closes the file for you.

TextBinaryCSV
Holdscharacters in linesbytes of Python objectsrows of fields, as text
Modulenonepicklecsv
Writewrite, writelinesdumpwriterow, writerows
Readread, readline, readlinesloadreader
End shown byempty stringEOFErrorend of the loop
ModeFile missingOld dataStarts at
r, r+errorkeptbeginning
w, w+createderasedbeginning
a, a+createdkeptend

Slip. Add b for binary: rb, wb+. Open CSV for writing with newline="".

Memory check: erases / read and add / why close 1. w and w+, and their b forms. 2. a+ (text) or ab+ (binary), with seek(0) before reading. 3. So that everything is written to disk and the file is free.

6. Text file

Rule. read() gives one string, readline() one line, readlines() a list. tell() reports the pointer, seek() moves it.

Write, then counttext file
with open("bees.txt", "w") as f:
    f.write("12 Orchard\n")
    f.writelines(["6 Canal\n", "9 Orchard\n"])

total = 0
with open("bees.txt", "r") as f:
    for line in f:
        kg, place = line.split()
        if place == "Orchard":
            total += int(kg)
print(total)
21

Slip. Every line keeps its newline until you strip or split it.

Memory check: write(12) / words or characters / second read() 1. TypeError, only strings can be written. 2. read().split() for words, a loop over read() for characters. 3. An empty string, unless seek(0) is called.

In full: text file handling

7. Binary file

Rule. One dump, one load. Read in an endless loop until EOFError. To update, read all into a list, change it, write all back.

Dump, searchpickle
import pickle

with open("hives.dat", "ab") as f:
    for rec in [[1, "Orchard", 21], [2, "Canal", 13.5]]:
        pickle.dump(rec, f)

try:
    with open("hives.dat", "rb") as f:
        while True:
            rec = pickle.load(f)
            if rec[2] > 15:
                print(rec[1])
except EOFError:
    print("End")
Orchard
End

Slip. Run it twice and Orchard prints twice, since ab keeps adding.

Memory check: dump order / search / mode for update 1. dump(object, file). 2. A flag set False before the loop; the message after it. 3. rb to read all, then wb to rewrite.

In full: binary and CSV programs

8. CSV file

Rule. writerow() takes one list, writerows() a list of lists. reader() gives lists of strings.

Write rows, add a columncsv
import csv

with open("honey.csv", "w", newline="") as f:
    w = csv.writer(f)
    w.writerow(["Place", "Kg"])
    w.writerows([["Orchard", 21], ["Canal", 13.5]])

with open("honey.csv", "r", newline="") as f:
    r = csv.reader(f)
    next(r)                     # past the headings
    total = 0
    for row in r:
        total += float(row[1])
print(total)
34.5

Slip. Forget next(r) and float("Kg") raises ValueError.

Memory check: CSV / writerow("Hi") / delimiter 1. Comma separated values. 2. Writes H,i: a string is taken letter by letter. 3. The separating character, a comma unless you change it.

9. Stack

Rule. Last in, first out. With a list, push is append(), pop is pop(), the top is index -1. Test for empty before popping.

Push with a conditionstack
Full = []

def push_full(stock):
    for place in stock:
        if stock[place] > 15:
            Full.append(place)

def pop_full():
    while Full:
        print(Full.pop())
    print("Underflow")

push_full({"Orchard": 21, "Canal": 13.5, "Hill": 18})
pop_full()
Hill
Orchard
Underflow

Slip. Looping with for over a list you are popping from. Use while.

Memory check: underflow / uses / push 1, push 2, pop, push 3 1. Popping when the stack is empty. 2. Undo, the back button, reversing. 3. Left: [1, 3].

In full: the stack

Unit 2. Cards 10 to 12

Computer networks short notes for Class 12

Unit 2 is learnt as contrasts. Each row below sets a word beside the one it is easily mistaken for.

10. Terms and media

In order: ARPANET (1969), NSFNET (1986), INTERNET.

Five parts: sender, receiver, message, medium, protocol.

PairTold apart by
Bandwidth, data ratehertz, bits per second
Circuit, packetreserved path, numbered pieces
IP, MACnetwork place, card's own number
Twisted pair, co-axialcheap, shielded
Fiber, the restlight, so no electrical noise
Radio, microwaveall round, straight line
Infraredone room only
Memory check: rate unit / cable for speed / hills between 1. bps. 2. Fiber-optic. 3. Radio waves.

11. Devices and shapes

JobDevice
Connect PCs, to all portsHub
Connect PCs, to one portSwitch
Join networks, pick a pathRouter
Door of the networkGateway
Strengthen past 100 mRepeater
Digital to analog and backModem
Fit a PC: wire, airEthernet card, WiFi card
PlugRJ45

By area: PAN, LAN, MAN, WAN. By shape: bus (one backbone), star (one centre), tree (stars on a backbone).

Memory check: star fails when / least cable / bank across a city 1. The centre fails. 2. Bus. 3. MAN.

12. Protocols and web

TaskProtocol
Web pageHTTP
Web page, encryptedHTTPS
FilesFTP
Mail out, mail inSMTP, POP3
CallsVoIP
Remote loginTELNET
Direct linkPPP
Base of the internetTCP/IP

Web: HTML shows, XML describes. A URL contains a domain name. A browser asks, a web server answers, hosting keeps the site there.

Memory check: POP3 / own tags / site name 1. Post Office Protocol version 3. 2. XML. 3. Domain name.

Drawings, full forms and 26 questions: computer networks for Class 12. The five-mark campus question: case study questions.

Unit 3. Cards 13 to 17

Database and SQL notes for Class 12 CS

Unit 3 is worth 20 marks: words about tables, commands on tables, and a Python program that sends those commands.

13. Relations and keys

Rule. A relation is a table, a tuple a row, an attribute a column. Degree counts columns, cardinality counts rows. A domain is the set of values allowed in a column.

The farm as two tablesMySQL
+-----+---------+------+------------+
| Hid | Place   | Bees | SetUp      |
+-----+---------+------+------------+
|   1 | Orchard | 9000 | 2024-03-01 |
|   2 | Canal   | 7000 | 2025-06-15 |
|   3 | Orchard | NULL | 2026-02-10 |
+-----+---------+------+------------+
+-----+------+------+
| Hno | Hid  | Kg   |
+-----+------+------+
|  21 |    1 |   12 |
|  22 |    2 |    6 |
|  23 |    1 |    9 |
|  24 |    2 |  7.5 |
+-----+------+------+

HIVE above has primary key Hid. HARVEST below has primary key Hno, and its Hid is a foreign key to HIVE. Candidate keys are all the possible identifiers; the ones not chosen are alternate keys.

Slip. Repeated values are normal in a foreign key.

Memory check: degree of HIVE / why a database / primary key allows 1. 4; its cardinality is 3. 2. Less repetition, consistent data, shared use. 3. No repeats and no NULL.

14. DDL: the structure

Create and alterSQL
CREATE DATABASE FARM;
USE FARM;
CREATE TABLE HIVE (
    Hid INT PRIMARY KEY,
    Place VARCHAR(15) NOT NULL,
    Bees INT,
    SetUp DATE
);
ALTER TABLE HARVEST ADD Grade CHAR(1);
ALTER TABLE HARVEST DROP COLUMN Grade;
ALTER TABLE HARVEST DROP PRIMARY KEY;
ALTER TABLE HARVEST ADD PRIMARY KEY (Hno);

Also: SHOW DATABASES, SHOW TABLES, DESC HIVE, DROP TABLE, DROP DATABASE. Types: char(n) fixed, varchar(n) variable, int, float, date. Constraints: NOT NULL, UNIQUE, PRIMARY KEY.

Slip. ALTER changes columns, UPDATE changes values.

Memory check: UNIQUE or PRIMARY KEY / see columns / char(5) with "ab" 1. UNIQUE permits NULL, and a table may have several. 2. DESC or DESCRIBE. 3. Stored as a fixed length of 5.

15. Rows and SELECT

Change rows, then askSQL
INSERT INTO HARVEST VALUES (25, 1, 4);
UPDATE HIVE SET Bees = Bees + 500 WHERE Hid = 2;
DELETE FROM HARVEST WHERE Kg < 5;

SELECT DISTINCT Place FROM HIVE;
SELECT Place, Bees FROM HIVE
WHERE Bees IS NOT NULL ORDER BY Bees DESC;
SELECT Hid FROM HIVE
WHERE SetUp BETWEEN '2025-01-01' AND '2025-12-31';
SELECT Place, Bees / 1000 AS Thousands FROM HIVE
WHERE Place LIKE 'C%';

BETWEEN includes both ends. IN checks a list. % is any run of characters, _ is exactly one. AS gives a column another name. Any sum with NULL is NULL.

Slip. Bees = NULL finds nothing. Forget WHERE in UPDATE or DELETE, and every row is hit.

Memory check: NULL / default order / second letter r 1. No value known; not zero, not blank. 2. ORDER BY is ascending. 3. LIKE '_r%'.

In full: SQL queries

16. Groups and joins

Aggregate, group, joinSQL
SELECT AVG(Bees), COUNT(Bees), COUNT(*) FROM HIVE;

SELECT Hid, SUM(Kg) FROM HARVEST
GROUP BY Hid HAVING SUM(Kg) > 15;

SELECT Place, Kg FROM HIVE, HARVEST
WHERE HIVE.Hid = HARVEST.Hid AND Kg > 8;

SELECT Hid, Place, Kg FROM HIVE NATURAL JOIN HARVEST
WHERE Place = 'Canal';

On the tables of card 13 these give: 8000.0000, 2 and 3; hive 1 with 21; Orchard 12 and Orchard 9; hive 2, Canal, 6 and 7.5.

WHERE picks rows, HAVING picks groups. With no condition, two tables give a Cartesian product: here 3 x 4 = 12 rows. A natural join matches the common column by itself and shows it once.

Slip. Writing Hid alone when both tables have it and there is no natural join.

Memory check: five aggregates / COUNT(*) / hive 3 in the join 1. MAX, MIN, AVG, SUM, COUNT. 2. Counts rows, NULL or not. 3. Absent: it has no harvest.

In full: joins with results

17. Python with MySQL

Connect, execute, commit, fetchPython with MySQL
import mysql.connector

con = mysql.connector.connect(host="localhost", user="root",
                              password="your_password",
                              database="FARM")
cur = con.cursor()
cur.execute("UPDATE HARVEST SET Kg = %s WHERE Hno = %s", (6.5, 22))
con.commit()
print(cur.rowcount, "row changed")
cur.execute("SELECT Hno, Kg FROM HARVEST WHERE Hid = %s", (2,))
for row in cur.fetchall():
    print(row[0], row[1])
con.close()
1 row changed
22 6.5
24 7.5

Rule. fetchone() gives one tuple or None, fetchall() a list of tuples. Commit after insert, update and delete, not after select.

Slip. (2) is a number; (2,) is a tuple.

Memory check: four objects and calls / rowcount / format() 1. connect, cursor, execute, commit or fetch. 2. How many rows the last command touched or returned. 3. Another way to place values: "... {}".format(22).

In full: connectivity programs

Q2. The notes are read. Now what?

What should you do after reading Class 12 CS notes?

Test yourself the same day, because a note feels known the moment it is read. Recall first, then questions, then a paper.

If you canThen doWhere
Answer the checks but not write the codeRewrite each card's code with another storyA blank page
Write code slowlyTwo short programs a day, timedImportant questions
Write code, lose one-mark itemsA 40-question setMCQ test
Do all thatA full paper in three hoursSample paper 2026-27
Nothing yet, and time is shortFollow dates, not moodsRevision plan

Not on any card, on purpose

Recursion, queues, linked lists, ring and mesh topologies, subqueries, views and triggers. They are in some books and in college courses, but the 083 syllabus for 2026-27 does not list them.

How a lesson uses a card

You shut the page and explain the topic. The teacher asks one "what if", you write a short program, and the first wrong line becomes the lesson. The card stays short; your own page beside it fills up.

From notes to answers

Notes stay quiet when you are wrong. A teacher does not.

You can read all 17 cards and still write w where a was needed, and no page will stop you. Our classes put one teacher beside one student, on the days and at the time you decide, with every line looked at. Have a whole lesson first through the priority demo: should you enrol, its fee is taken off month one. There is a free demo class too. Monthly billing, no admission fee, and the freedom to stop when any month ends.

Before you enrol · Try a class

Priority demo, at a slot you pick

a full live class of about 45 to 60 minutes

  • Memory checks from three cards you choose, asked aloud
  • One card rewritten as a program, in your own hand
  • The weakest topic taught again, from the beginning
  • A written skill report that lists cards as safe or shaky
Book a priority demo

The classes · Choose your own timing

Personalised one to one

₹4,999

per month, 4 private classes, fully flexible timing

  • A topic a lesson, in the order your school test needs
  • Your own notebook corrected, so your notes are right
  • Recall of old cards before anything new starts
  • Practical file, project questions and viva on the way
Ask for a personalised plan

Most students know about half the cards when they arrive, and not always the half they think. We find out which, then skip it. You will see the monthly fee in your own currency on this page.

Studying outside India?

The same cards, read in other countries

Computer Science 083 does not change at the border: a student in Muscat, Kuwait or Kathmandu revises the same three units. Choose an afternoon, a late evening or a weekend for your class.

Where you liveTime differenceUsual class window, local timeFormat
India
every Indian city
Indian timeAny time you choosePersonalised 1-on-1
UAE and Oman
Dubai, Abu Dhabi, Sharjah, Muscat
1 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Saudi Arabia, Qatar, Kuwait, Bahrain
Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama
2 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Nepal
Kathmandu
15 min ahead of India4:30 PM to 9:00 PMPersonalised 1-on-1
Ethiopia and East Africa
Addis Ababa and East Africa Time
2 h 30 min behind India4:30 PM to 9:00 PMPersonalised 1-on-1
Singapore and Malaysia
Singapore, Kuala Lumpur
2 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 1-on-1

Students who changed schools in the middle of Class 11 often have a missing chapter. Tell us which book you used and where you stopped; that is enough to begin.

What families say

Rated 4.9 across 547 Google reviews

Real reviews from real families. We neither write nor commission them.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

The rest of the Class 12 series

More pages for Class 12 students

Every page in the CBSE Class 12 Computer Science series, grouped by what you need.

Questions about notes

Class 12 computer science notes: what students ask

Where can I get Class 12 computer science notes for 2026-27?

This page has short notes on the complete CBSE 083 syllabus in 17 cards, free to read, with tested code and memory checks. Each card links to a longer page on that chapter. The official topic list is the CBSE curriculum document for Computer Science, which you should keep beside any notes.

Are these notes chapter wise?

Yes. Cards 1 to 9 follow Unit 1, from Python revision to the stack. Cards 10 to 12 follow Unit 2, computer networks. Cards 13 to 17 follow Unit 3, from relations and keys to Python with MySQL. The table near the top links to every card.

Is there a PDF of the Class 12 CS notes?

We do not offer a PDF. The page opens on a phone and can be printed from a browser if you like paper. Better still, copy each card by hand once and its code a second time from memory, since the copying is what makes it stay.

How many chapters are there in Class 12 Computer Science?

The syllabus is set out as three units, not chapters: Computational Thinking and Programming 2 with 40 marks, Computer Networks with 10 and Database Management with 20. Books divide these into different numbers of chapters, so compare topics and not chapter numbers.

Are short notes enough for Class 12 Computer Science?

They are enough to revise, not to learn from zero. Most of the paper asks you to write programs, queries and outputs, and that needs practice. Use notes to remind yourself of a rule, then write something that uses the rule on the same day.

Which topics are most important in Class 12 CS?

By marks, programming with functions, files and stack is 40 of the 70, and databases are 20. In the 2026-27 sample paper, files, SQL and connectivity carry the long questions. Networks is small, but its ten marks can be secured in a few evenings.

How do I make my own notes for computer science?

Give each topic one side of paper: the rule in a sentence, the smallest code that shows it, its output, and the mistake you made last time. Leave a margin for three questions to yourself. If it runs to a second side, it has become a textbook again.

Can I study Class 12 computer science without a book?

You can revise without one, but you still need the official syllabus, practice questions and a computer to run programs on. Your school follows a book for classwork and tests, so use it for exercises and these cards for recall.

What is in Class 12 CS Python notes that was not in Class 11?

Writing your own functions with parameters and scope, exception handling, text, binary and CSV files, and the stack implemented with a list. Class 11 topics such as strings, lists, tuples and dictionaries are revised, because they appear inside almost every question.

How long does it take to revise the whole syllabus from notes?

At about ten minutes a card, one reading of these 17 takes around three hours. Recalling and rewriting the code takes several times that. Spread it over two or three weeks, and return to the shaky cards on the next day and in the next week.

Do you teach from these notes in class?

They are a starting point. In a one to one class the order, the depth and the examples are chosen for the student, and much of the time goes on programs the student writes. You choose the days and the timing, and a demo class comes before any decision.

Start

Tell us your shaky cards

List the card numbers you could not recall, nothing more, and book a priority demo at a slot that suits you. It is a full live class of about 45 to 60 minutes on exactly those cards. A written skill report comes after it, and if you enrol the demo fee is set against your first month.

If you would like something lighter, ask for the free demo class. Practical soon? Read the viva questions next.

WhatsApp us · +91 91233 66161 · connect@modernagecoders.com

Every class is live video. The form requests a callback and reserves nothing.

We call within a few hours. No card, no enrolment fee.

Want it sooner? Book a priority demo

A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.

Book a priority demo

Keep exploring Modern Age Coders

By class and age

Learn more

Free resources

From the blog

Start here