CBSE Class 12 · Computer Science, code 083 · Sample paper 2026-27

Class 12 Computer Science sample paper 2026-27, a full 70 marks with worked answers.

This class 12 computer science sample paper for 2026-27 is a complete, original practice paper: 37 questions, 70 marks, three hours, in the design of the official CBSE paper and with the same internal choices in the same places. Write it on paper first. Each answer is folded under its question, worked the way a marking scheme would split it, and every Python output was run before it was printed here.

Live online, one to one · 37 original questions · every program run · step marks shown · your own days and timing · first class free

Start here

Courses that sit behind this paper

Computer Science for Classes 11 and 12 covers the whole syllabus this paper samples. The Python and MySQL courses are for a student whose marked paper shows one of the two as the weak half.

Ans. The short version

The Class 12 Computer Science sample paper for 2026-27 (CBSE code 083) has 37 compulsory questions for 70 marks in three hours: Section A 21 of one mark, B seven of two, C three of three, D four of four and E two of five, with an internal choice in ten questions. This page gives a full original paper in that design, with every answer worked and every Python output run. Modern Age Coders marks such papers live, in personalised one to one classes at your own time. Try a priority demo first: a full live class with a written skill report.

Q1. What is in the official paper?

What does the CBSE Class 12 Computer Science sample paper 2027 look like?

The official 083 sample question paper for 2026-27 has 37 questions and 70 marks in five sections, and it states on every page that the design has not changed this session.

SectionQuestionsMarks eachTotalChoice inside
A1 to 21121none
B22 to 2821422, 24, 25, 27, 28
C29 to 313929, 31
D32 to 3541632, and one part of 34
E36 to 37510one part of 37
Total377010 questions

The board paper is on Wednesday 31 March 2027, 10:30 AM to 1:30 PM, according to the CBSE date sheet of 6 November 2026. Programs are written in Python only, and in an MCQ the text of the correct option must be written, not just its letter. More on the rules is on the exam date, pattern and marks page.

We counted the official paper by unit

UnitQuestions in the SQPMarks
Computational Thinking and Programming 21 to 3, 5 to 7, 10, 11, 14, 16, 18, 20, 22 to 26, 29 to 31, 33, 3640
Computer Networks8, 12, 17, 28, 3710
Database Management4, 9, 13, 15, 19, 21, 27, 32, 34, 3520

The count lands exactly on the syllabus split of 40, 10 and 20, and the practice paper below is built on the same question numbers. Section A of the official paper has 15 MCQs, four questions with no options (1, 10, 14 and 18) and two assertion and reason items. Ours repeats that shape too.

Q2. How do I read the SQP and its marking scheme?

How should you use the official sample paper and marking scheme?

Download both files from the sample question paper section of cbseacademic.nic.in, write the paper before opening the scheme, and then read the scheme for its steps, because that is where half marks are named.

Official questionHow the 2026-27 scheme splits itWhat that tells you to write
23, error correction (2)Half a mark for each of four mistakesFind four, not two, and underline each
30, stack (3)One and a half marks for each functionA correct push alone is already half the question
33, CSV (4)Half marks for mode, writer or reader object, conversion, displayName the mode in open() and convert with int()
35, connectivity (4)Half each for import, connection, cursor and closing; one for the query; one for execute with commitWrite every line even if the query is in doubt
36, binary file (2 + 3)One mark for load() in a loop with try and except, one for the condition and updateNever read a binary file without handling its end
37, network (5)One mark for each partFive short answers, each with a reason

Return it and print it

Official Question 24A asks for a function that returns a list, while the sample answer prints it, and 33 (II) asks to return a total the sample answer prints. Protect yourself: return the value as asked, then print the call.

Missing imports are forgiven, once

The scheme says to ignore import csv in Question 33 and import pickle in Question 36, since they may belong to the larger program. In Question 35 the import of the connector carries half a mark. Simplest habit: always write it.

Similar logic is accepted

The scheme often says "correct or similar logic". Your loop need not match the printed one. It needs to do the job, with the header, the file mode and the output in place.

Practice paper. Section A, 21 marks

Sample paper class 12 computer science 2026-27 with solutions: Section A

Questions 1 to 21, one mark each. Allow 30 minutes. For 20 and 21 choose from: (a) both true and R explains A, (b) both true and R does not explain A, (c) A true and R false, (d) A false and R true.

  1. Q1. Write the output of the following code. (1 mark)
    Q1lists
    L = [4, 8, 15, 16]
    L.extend([23, 42])
    L.pop(2)
    print(L)
    Answer [4, 8, 16, 23, 42]. extend() joins the two new items to the end, then pop(2) removes the item at index 2, which is 15.
  2. Q2. What is the output of the following code? (1 mark)
    Q2strings
    place = "Andaman and Nicobar"
    print(place.partition("and"))
    (a) ['Andaman ', ' Nicobar']
    (b) ('', 'And', 'aman and Nicobar')
    (c) ('Andaman ', 'and', ' Nicobar')
    (d) ['Andaman', 'and', 'Nicobar']
    Answer (c) ('Andaman ', 'and', ' Nicobar'). partition() always gives a tuple of three strings, and the search is case sensitive, so the capital A of Andaman does not match.
  3. Q3. Which of these can be used as a key in a Python dictionary? (1 mark)
    (a) [3, 4]
    (b) {"a": 1}
    (c) (3, 4)
    (d) [(3, 4)]
    Answer (c) (3, 4). A key must be immutable. Lists and dictionaries are mutable; a tuple of integers is not.
  4. Q4. In the relation MEMBER, both AdmNo and Email can identify a row. AdmNo is chosen as the primary key. Email is now called: (1 mark)
    (a) a foreign key
    (b) an alternate key
    (c) a composite key
    (d) a domain
    Answer (b) an alternate key. Both columns are candidate keys; the candidate that is not chosen as the primary key is the alternate key.
  5. Q5. Consider the code below. What happens when it is run? (1 mark)
    Q5functions
    def fare(rate=12, km):
        return rate * km
    
    print(fare(5))
    (a) It prints 60
    (b) It prints 5
    (c) SyntaxError, because a parameter without a default follows one that has a default
    (d) NameError, because km is not defined
    Answer (c) SyntaxError, because a parameter without a default follows one that has a default. Default parameters must come last, as in def fare(km, rate=12).
  6. Q6. Which output is possible when this code is run? (1 mark)
    Q6random
    import random
    cities = ["Kochi", "Pune", "Surat", "Agra", "Leh"]
    start = random.randrange(0, 2)
    stop = random.randint(2, 3)
    for i in range(start, stop):
        print(cities[i], end="#")
    (a) Kochi#Pune#Surat#Agra#
    (b) Pune#Surat#
    (c) Surat#
    (d) Pune#Surat#Agra#
    Answer (b) Pune#Surat#. randrange(0, 2) gives 0 or 1; randint(2, 3) gives 2 or 3. The four possible outputs are Kochi#Pune#, Kochi#Pune#Surat#, Pune# and Pune#Surat#.
  7. Q7. Predict the output. (1 mark)
    Q7dictionary
    stock = {"pen": 40, "chalk": 25}
    print(stock.get("ink", 0) + stock["pen"])
    (a) 40
    (b) Error
    (c) None
    (d) 0
    Answer (a) 40. The key "ink" is missing, so get() returns the second argument, 0, and 0 + 40 is 40.
  8. Q8. Which transmission medium carries data as light and is not affected by electrical noise? (1 mark)
    (a) Twisted pair cable
    (b) Co-axial cable
    (c) Fiber-optic cable
    (d) Microwaves
    Answer (c) Fiber-optic cable. The signal is light inside glass or plastic, so electrical interference does not reach it.
  9. Q9. Which query lists the students whose name has "a" as its second letter? (1 mark)
    (a) SELECT * FROM Student WHERE Name LIKE 'a%';
    (b) SELECT * FROM Student WHERE Name LIKE '_a%';
    (c) SELECT * FROM Student WHERE Name LIKE '%a_';
    (d) SELECT * FROM Student WHERE Name = '_a%';
    Answer (b) SELECT * FROM Student WHERE Name LIKE '_a%'; The underscore stands for exactly one character and % for any number of characters.
  10. Q10. What is the output of this statement? (1 mark)
    Q10expression
    print(17 // 4 + 2 ** 3 % 5 - 6 / 2)
    Answer 4.0. First 2 ** 3 is 8. Then, left to right: 17 // 4 is 4, 8 % 5 is 3, 6 / 2 is 3.0. Finally 4 + 3 - 3.0 is 4.0, a float because of the single slash.
  1. Q11. What is the data type of the value of [1] * 3 == [1, 1, 1]? (1 mark)
    (a) list
    (b) int
    (c) bool
    (d) str
    Answer (c) bool. A comparison always gives True or False; here it is True.
  2. Q12. The ________ protocol lets a mail program collect messages from the mail server. (1 mark)
    (a) SMTP
    (b) POP3
    (c) FTP
    (d) PPP
    Answer (b) POP3. SMTP sends mail; POP3 brings received mail to the client.
  3. Q13. Two members may share the same city, but no row may leave the City column empty. Which constraint should City have? (1 mark)
    (a) UNIQUE
    (b) PRIMARY KEY
    (c) NOT NULL
    (d) DISTINCT
    Answer (c) NOT NULL. UNIQUE and PRIMARY KEY would stop repeats, and DISTINCT is a clause of SELECT, not a constraint.
  4. Q14. What will the file split.txt contain after this code is run? (1 mark)
    Q14exceptions and files
    def share(total, people):
        try:
            each = total // people
            with open("split.txt", "w") as f:
                f.write(str(each))
        except ZeroDivisionError:
            with open("split.txt", "w") as f:
                f.write("No people")
        finally:
            with open("split.txt", "a") as f:
                f.write("!")
    
    share(90, 4)
    Answer 22! The division succeeds, so 22 is written and the except block is skipped. The finally block always runs and adds the exclamation mark.
  5. Q15. A table has 5 columns and 9 rows. Two rows are deleted and one column is added. Its degree and cardinality are now: (1 mark)
    (a) degree 6, cardinality 7
    (b) degree 7, cardinality 6
    (c) degree 5, cardinality 7
    (d) degree 6, cardinality 9
    Answer (a) degree 6, cardinality 7. Degree counts attributes (5 + 1); cardinality counts tuples (9 - 2).
  6. Q16. What is the output of the following code? (1 mark)
    Q16scope
    total = 5
    def bill(amount):
        global total
        total = total + amount
        return total * 2
    print(bill(3), total)
    (a) 16 5
    (b) 16 8
    (c) 10 8
    (d) Error
    Answer (b) 16 8. Because of global, the function changes the outer total to 8 and returns 16. The arguments of print are worked out left to right, so total is already 8.
  7. Q17. The range of frequencies a channel can carry, measured in hertz, is its ________. (1 mark)
    (a) bandwidth
    (b) protocol
    (c) topology
    (d) IP address
    Answer (a) bandwidth. Data transfer rate, by contrast, is measured in bits per second.
  8. Q18. What is the output of the following code? (1 mark)
    Q18slicing
    text = "Winter Olympics"
    print(text[9:2:-2])
    Answer yOrt. Index 9 is y. Stepping back by two gives indexes 9, 7, 5 and 3: y, O, r, t. Index 2 is not reached.
  9. Q19. Which command adds a column Email to the existing table Member? (1 mark)
    (a) UPDATE Member ADD Email VARCHAR(30);
    (b) ALTER TABLE Member ADD Email VARCHAR(30);
    (c) INSERT INTO Member ADD Email VARCHAR(30);
    (d) ALTER Member INSERT Email VARCHAR(30);
    Answer (b) ALTER TABLE Member ADD Email VARCHAR(30); ALTER TABLE changes structure; UPDATE and INSERT change data.
  10. Q20. Assertion (A): Three records written by three pickle.dump() calls need three pickle.load() calls to be read back. Reason (R): Each call to load() reads one pickled object from the file. (1 mark)
    Answer (a) Both A and R are True and R is the correct explanation for A. This is why a binary file is read in a loop that ends on EOFError.
  11. Q21. Assertion (A): COUNT(*) and COUNT(Marks) always give the same number. Reason (R): COUNT(column) does not count NULL values. (1 mark)
    Answer (d) A is False but R is True. If any row has NULL in Marks, COUNT(*) is larger, and R tells you why.

If Questions 2, 6 or 18 slowed you down, take a set from Class 12 CS output questions before the next paper.

Practice paper. Section B, 14 marks

Section B: seven short answers of two marks

Questions 22 to 28. Allow 35 minutes. Where a question says OR, answer one side only.

  1. Q22. A. Differentiate between positional parameters and default parameters, with an example. OR B. Differentiate between readline() and readlines(), with an example. (2 marks)
    Answer A. A positional parameter takes its value from the argument in the same place in the call, and the call must supply it. A default parameter has a value in the function header, which is used when the call leaves it out.
    Q22 Aoutput 600, then 800
    def ticket(seats, price=150):   # seats positional, price default
        return seats * price
    
    print(ticket(4))        # price takes 150
    print(ticket(4, 200))   # price takes 200
    B. readline() reads one line and returns it as a string; readlines() reads all the remaining lines and returns a list of strings. Both keep the newline character.
    Q22 Bone line, then a list
    with open("menu.txt", "w") as f:
        f.write("Idli\nPoha\nUpma\n")
    
    with open("menu.txt", "r") as f:
        print(repr(f.readline()))
        print(f.readlines())
    
    # Output:
    # 'Idli\n'
    # ['Poha\n', 'Upma\n']
    One mark for the difference, half a mark for each part of the example.
  2. Q23. The function below should return the sum of the even numbers in a list. It has syntax and logical errors. Rewrite it correctly and underline each correction. (2 marks)
    Q23find four errors
    def even_total(nums)
        total = 0
        for n in nums:
            if n % 2 = 0:
                total = n
        Return total
    print(even_total([3, 8, 10]))
    Answer
    Q23 correctedoutput 18
    def even_total(nums):           # 1. colon added
        total = 0
        for n in nums:
            if n % 2 == 0:          # 2. == compares
                total += n          # 3. logical error: add, do not replace
        return total                # 4. small r
    print(even_total([3, 8, 10]))
    Half a mark for each of the four corrections. The third one is the logical error: the code would run without it being fixed, but the answer would be 10.
  3. Q24. A. Write a function long_names(names) that takes a list of names and returns a new list of those with more than six letters, in capitals. For ["Meera", "Siddharth", "Anjali", "Kartikeya"] it returns ["SIDDHARTH", "KARTIKEYA"]. OR B. Write a function below_average(temps) that prints how many temperatures in the list are below the average. For [30, 26, 35, 29] it prints 2. (2 marks)
    Answer
    Q24 Areturns a list
    def long_names(names):
        result = []
        for name in names:
            if len(name) > 6:
                result.append(name.upper())
        return result
    
    print(long_names(["Meera", "Siddharth", "Anjali", "Kartikeya"]))
    # Output: ['SIDDHARTH', 'KARTIKEYA']
    Q24 Bprints a count
    def below_average(temps):
        average = sum(temps) / len(temps)
        count = 0
        for t in temps:
            if t < average:
                count += 1
        print(count)
    
    below_average([30, 26, 35, 29])
    # Output: 2
    Half a mark for the header, one for the logic, half for the return or print the question asks for. Anjali has exactly six letters, so it stays out.
  4. Q25. A. Using built-in functions and methods only: (I) given route = "Delhi-Agra-Gwalior", write a statement to get a list of the three cities; (II) given scores = [12, 45, 7, 45, 30], write a statement to get the index of the first occurrence of the largest value. OR B. Predict the output. (2 marks)
    Q25 Bstring methods
    word = "balloon"
    print(word.count("l") + word.index("o"))
    print(word.title().isupper())
    Answer A. (I) route.split("-"), which gives ['Delhi', 'Agra', 'Gwalior']. (II) scores.index(max(scores)), which gives 1. One mark each.
    B. First line 6: there are two letter l, and the first o is at index 4. Second line False: title() gives Balloon, which is not all capitals. One mark each.
  5. Q26. Predict the output. (2 marks)
    Q26trace the string
    data = {"A": 3, "B": 5, "C": 2}
    out = ""
    for key in data:
        if data[key] % 2 != 0:
            out = key * data[key] + out
        else:
            out = out + "-" + str(data[key])
    print(out)
    Answer BBBBBAAA-2
    keyvaluebranchout after the pass
    A3odd, put in frontAAA
    B5odd, put in frontBBBBBAAA
    C2even, add at the endBBBBBAAA-2
  6. Q27. A. Write MySQL commands to: (I) make BookID the primary key of the existing table BOOK; (II) display the structure of the table BOOK. OR B. Differentiate between CHAR(n) and VARCHAR(n), with an example. (2 marks)
    Answer A. (I) ALTER TABLE BOOK ADD PRIMARY KEY (BookID); (II) DESC BOOK; or DESCRIBE BOOK; One mark each.
    B. CHAR(n) is a fixed-length string: a shorter value is padded with spaces to n characters in storage, so it suits values of equal length, such as PinCode CHAR(6). VARCHAR(n) is a variable-length string: only the characters entered are stored, up to n, so it suits values such as Name VARCHAR(30). One mark for the difference, half for each example.
  7. Q28. A. Expand SMTP and HTTPS and state one use of each. OR B. Define bus topology and write one advantage of it. (2 marks)
    Answer A. SMTP is Simple Mail Transfer Protocol; it sends e-mail from a client to a mail server and between mail servers. HTTPS is Hypertext Transfer Protocol Secure; it loads web pages over an encrypted connection, as on a payment page. Half a mark for each full form and each use.
    B. In a bus topology all the computers are connected to one main cable, the backbone, with a terminator at each end. Advantage: it needs less cable than star and is easy to set up for a small network. One mark for each part.

Practice paper. Section C, 9 marks

Section C: three programs of three marks

Questions 29 to 31: a text file, a stack and a function on a list. Allow 25 minutes.

  1. Q29. A. Write and call a function to read the text file Diary.txt, display every non-blank line that has fewer than five words, and finally display how many lines were shown. OR B. Write a function count_capitals() that displays the number of words in Report.txt that begin with a capital letter. (3 marks)
    Answer
    Q29 Atext file, line by line
    def show_short_lines():
        count = 0
        with open("Diary.txt", "r") as file:
            for line in file:
                words = line.split()
                if 0 < len(words) < 5:      # blank lines have 0 words
                    print(line.strip())
                    count += 1
        print("Lines shown:", count)
    
    show_short_lines()
    For a Diary.txt of four lines, "Rain all day", a blank line, "We planted two neem trees today" and "Slept early", it printed:
    Output of Q29 Aour test file
    Rain all day
    Slept early
    Lines shown: 2
    Q29 Btext file, word by word
    def count_capitals():
        count = 0
        with open("Report.txt", "r") as file:
            words = file.read().split()
        for word in words:
            if word[0].isupper():
                count += 1
        print("Words with a capital letter:", count)
    
    count_capitals()
    With "The ISRO team met Asha in Pune today" in Report.txt it printed Words with a capital letter: 4. Half a mark each for the header, opening the file, reading, splitting, the counter and the display.
  2. Q30. A list holds flight number, city and delay in minutes: Flights = [["KV204", "Delhi", 45], ["KV310", "Pune", 10], ["KV118", "Goa", 75], ["KV522", "Surat", 35]]. Write user-defined functions on a stack named Delayed: (I) push_delayed() pushes the flight number of every flight delayed by more than 30 minutes; (II) pop_delayed() pops and displays the flight numbers, then displays "No delayed flight left". Expected output: KV522, KV118, KV204 and the message, each on its own line. (3 marks)
    Answer
    Q30stack using a list
    Flights = [["KV204", "Delhi", 45], ["KV310", "Pune", 10],
               ["KV118", "Goa", 75], ["KV522", "Surat", 35]]
    Delayed = []
    
    def push_delayed():
        for flight in Flights:
            if flight[2] > 30:
                Delayed.append(flight[0])
    
    def pop_delayed():
        while Delayed:                  # stops at an empty stack
            print(Delayed.pop())
        print("No delayed flight left")
    
    push_delayed()
    pop_delayed()
    
    # Output:
    # KV522
    # KV118
    # KV204
    # No delayed flight left
    One and a half marks for each function. The last flight pushed comes out first; that reversed order is how the examiner sees that it is a stack.
  3. Q31. A. Write a function widest_gap(readings) that returns the largest difference between two neighbouring numbers in a list. For [12, 19, 15, 28, 26] it returns 13. OR B. Write a function grade_count(marks) that returns a dictionary with the number of grades A (80 and above), B (60 to 79) and C (below 60). For [91, 64, 47, 80, 59] it returns {'A': 2, 'B': 1, 'C': 2}. (3 marks)
    Answer
    Q31 Aneighbouring items
    def widest_gap(readings):
        widest = 0
        for i in range(len(readings) - 1):      # stop one before the end
            gap = abs(readings[i] - readings[i + 1])
            if gap > widest:
                widest = gap
        return widest
    
    print(widest_gap([12, 19, 15, 28, 26]))
    # Output: 13
    Q31 Bcounting with a dictionary
    def grade_count(marks):
        grades = {"A": 0, "B": 0, "C": 0}
        for m in marks:
            if m >= 80:
                grades["A"] += 1
            elif m >= 60:
                grades["B"] += 1
            else:
                grades["C"] += 1
        return grades
    
    print(grade_count([91, 64, 47, 80, 59]))
    # Output: {'A': 2, 'B': 1, 'C': 2}
    Half a mark for the header, two for the logic, half for the return.

More stack sets of this shape, with lists and dictionaries, are on the stack page for Class 12.

Practice paper. Section D, 16 marks

Section D: SQL, CSV and Python with MySQL

Questions 32 to 35 carry 16 marks, 12 of them for databases. Allow 45 minutes.

  1. Q32. Study the table TREK_BOOKING. (4 marks)
    BookIDTrekkerTrekAgeFee
    B01AnanyaHampta178500
    B02FarhanKedarkantha197200
    B03RohanHampta218500
    B04DiyaRoopkund1811000
    B05IshaanKedarkantha167200
    B06NandiniHampta188500
    A. Write queries: (I) to display each trek and the total fee collected for it, only where the total is more than 12000; (II) to display the names of trekkers aged 17 to 19; (III) to display all details of trekkers whose names end with n; (IV) to display all records in ascending order of age. OR B. Predict the output:
    (I) SELECT Trek, COUNT(*) FROM TREK_BOOKING GROUP BY Trek;
    (II) SELECT Trekker, Fee FROM TREK_BOOKING WHERE Trek LIKE 'Ke%';
    (III) SELECT DISTINCT Fee FROM TREK_BOOKING ORDER BY Fee DESC;
    (IV) SELECT MIN(Age), MAX(Fee) FROM TREK_BOOKING WHERE Fee < 10000;
    Answer
    Q32 Aone mark each
    SELECT Trek, SUM(Fee) FROM TREK_BOOKING
    GROUP BY Trek HAVING SUM(Fee) > 12000;
    
    SELECT Trekker FROM TREK_BOOKING
    WHERE Age BETWEEN 17 AND 19;
    
    SELECT * FROM TREK_BOOKING WHERE Trekker LIKE '%n';
    
    SELECT * FROM TREK_BOOKING ORDER BY Age;
    On this data (I) gives Hampta 25500 and Kedarkantha 14400, (II) gives Ananya, Farhan, Diya and Nandini, (III) gives the rows of Farhan, Rohan and Ishaan, and (IV) begins with Ishaan and ends with Rohan; Diya and Nandini are both 18, so either may come first.
    B. (I)
    TrekCOUNT(*)
    Hampta3
    Kedarkantha2
    Roopkund1
    (II)
    TrekkerFee
    Farhan7200
    Ishaan7200
    (III)
    Fee
    11000
    8500
    7200
    (IV)
    MIN(Age)MAX(Fee)
    168500
    In (IV) Diya's row is filtered out before MIN and MAX are worked out, so the largest fee is 8500, not 11000.
  2. Q33. Neha's fitness club keeps a CSV file Workouts.csv with the columns Member_ID, Activity, Minutes and Calories and no heading row. Write user-defined functions: (I) add_workout() to accept one workout from the user and append it to the file; (II) calories_of(activity) to calculate and return the total calories for the given activity. (4 marks)
    Answer
    Q33CSV append and read
    import csv
    
    def add_workout():
        member = input("Member ID: ")
        activity = input("Activity: ")
        minutes = int(input("Minutes: "))
        calories = int(input("Calories: "))
        with open("Workouts.csv", "a", newline="") as file:
            writer = csv.writer(file)
            writer.writerow([member, activity, minutes, calories])
        print("Workout saved")
    
    def calories_of(activity):
        total = 0
        with open("Workouts.csv", "r", newline="") as file:
            reader = csv.reader(file)
            for row in reader:
                if row[1] == activity:
                    total += int(row[3])    # CSV values are strings
        return total
    We added three rows through the function, (F01, Yoga, 40, 160), (F02, Cycling, 30, 280) and (F01, Yoga, 25, 100); calories_of("Yoga") then returned 260. Two marks for each function, half a mark a step: in part I input, append mode, writer object, writerow; in part II read mode, reader object, the sum with int(), the returned total.
  3. Q34. Two tables store museum visits. (4 marks)
    MIDMNameCityTicket
    M1Rail Heritage HallKolkata60
    M2Textile GalleryJaipur40
    M3Coin HouseJaipur50
    M4Harbour MuseumKochi80
    The table above is MUSEUM; the table below is TOUR.
    TIDMIDSchoolTDateStudents
    T1M2Hillview School2026-09-1842
    T2M4Lotus Academy2026-10-0535
    T3M2Riverside School2026-11-1250
    T4M1Lotus Academy2026-12-0228
    T5M3Hillview School2026-10-2031
    Write MySQL queries: (I) to increase the ticket by 20 for all museums in Jaipur; (II) to display all details of tours after 1 October 2026; (III) to display TID, School and MName for tours of museums in Kolkata or Jaipur; (IV) a. to display School, MName and Ticket for every tour using a natural join or b. to display MID and the total number of students for each museum that was toured.
    Answer
    Q34one mark each
    UPDATE MUSEUM SET Ticket = Ticket + 20 WHERE City = 'Jaipur';
    
    SELECT * FROM TOUR WHERE TDate > '2026-10-01';
    
    SELECT TID, School, MName FROM TOUR, MUSEUM
    WHERE TOUR.MID = MUSEUM.MID AND City IN ('Kolkata', 'Jaipur');
    
    SELECT School, MName, Ticket FROM TOUR NATURAL JOIN MUSEUM;
    
    SELECT MID, SUM(Students) FROM TOUR GROUP BY MID;
    Check on the data: (I) changes two rows, to 60 and 70; (II) returns T2, T3, T4 and T5; (III) returns T1, T3, T4 and T5; the last query gives M1 28, M2 92, M3 31 and M4 35. In (III) the join condition is what earns the mark: without TOUR.MID = MUSEUM.MID the query is a cartesian product.
  4. Q35. A MySQL database ClinicDB has the table appointments with the attributes Token (integer), Patient (string), Doctor (string) and Fee (integer). Connection details: username frontdesk, password clinic#27, host localhost. Write a Python-MySQL program to accept a doctor's name from the user, display all the appointments of that doctor, and display how many were found. (4 marks)
    Answer
    Q35program only, nothing to commit
    import mysql.connector
    
    con = mysql.connector.connect(host="localhost", user="frontdesk",
                                  password="clinic#27", database="ClinicDB")
    cur = con.cursor()
    
    doctor = input("Doctor's name: ")
    query = "SELECT * FROM appointments WHERE Doctor = %s"
    cur.execute(query, (doctor,))       # one value still needs a tuple
    
    rows = cur.fetchall()
    for row in rows:
        print(row)
    print("Appointments found:", cur.rowcount)
    
    cur.close()
    con.close()
    Half a mark each for the import, the connection, the cursor and the closing lines; one mark for the query with the placeholder; one for executing it, fetching and displaying. SELECT changes nothing, so there is no commit(). If your paper asks for INSERT, UPDATE or DELETE, con.commit() is part of the mark. This program was checked for syntax, not against a server, so no console output is shown.

Drill the two halves on their own pages: Class 12 SQL queries and Python MySQL connectivity.

Practice paper. Section E, 10 marks

Section E: the binary file and the network case

Questions 36 and 37, five marks each. Allow 25 minutes. Question 36 has no choice; Question 37 has a choice in its last part.

  1. Q36. Arun handles billing for a housing society. Each record is a list: Flat_No, Owner, Bill, Paid ("Yes" or "No"). Write Python functions to: (I) input the records and append them to the binary file Society.dat; (II) add a late fee of 150 to the Bill of every owner whose Paid is "No" and display how many bills changed. (2 + 3 marks)
    Answer
    Q36pickle: append, then update
    import pickle
    
    def add_record():
        flat = input("Flat number: ")
        owner = input("Owner: ")
        bill = int(input("Bill: "))
        paid = input("Paid (Yes/No): ")
        record = [flat, owner, bill, paid]
        with open("Society.dat", "ab") as file:
            pickle.dump(record, file)
    
    def add_late_fee():
        records = []
        changed = 0
        try:
            with open("Society.dat", "rb") as file:
                while True:
                    record = pickle.load(file)
                    if record[3] == "No":
                        record[2] += 150
                        changed += 1
                    records.append(record)      # every record is kept
        except EOFError:
            pass                                # end of the file reached
        with open("Society.dat", "wb") as file:
            for record in records:
                pickle.dump(record, file)
        print("Bills changed:", changed)
    We entered ("A101", "Meenal", 1800, "Yes"), ("A102", "Joseph", 2100, "No") and ("B204", "Tanvi", 1650, "No"), then called add_late_fee(). It printed Bills changed: 2, and the file then held 1800, 2250 and 1800. Part I: header, append mode, input and dump, half a mark each. Part II: header half, opening half, load in a loop with try and except one, the condition and the update one. Append the record to the list outside the if, or every paid owner disappears from the file.
  2. Q37. Sahyadri Hospital Trust is joining four blocks at its Kochi campus. (5 marks)
    BlocksDistance
    OPD to Lab60 m
    OPD to Pharmacy40 m
    OPD to Admin115 m
    Lab to Pharmacy75 m
    Lab to Admin130 m
    Pharmacy to Admin85 m
    BlockComputers
    OPD90
    Lab45
    Pharmacy20
    Admin35
    (I) Suggest the block for the server, with a reason. (II) Suggest a topology in which every block connects directly to the server block, and draw the cable layout. (III) Where would you place (a) a repeater (b) a switch? (IV) The Kochi network is to be linked to the head office in Bengaluru. Name the type of network formed and the device that joins the Kochi LAN to it. (V) A. Which protocol is used to transfer large scan files from the Lab to the server? OR B. What is TELNET used for?
    Answer (I) OPD, because it has the most computers, so most of the traffic stays inside the server block.
    (II) Star topology, with OPD at the centre:
    Q37 (II)cable layout
     Lab ------- 60 m -------+
                             |
     Pharmacy -- 40 m ----- OPD (server)
                             |
     Admin ---- 115 m -------+
            (repeater on this cable)
    (III) (a) A repeater on the cable from OPD to Admin, since 115 m is more than 100 m and the signal weakens. (b) A switch in every block, to connect the computers of that block to each other and to the cable.
    (IV) WAN, because the two cities are far apart; a router joins the Kochi LAN to it.
    (V) A. FTP, File Transfer Protocol. OR B. TELNET lets a user log in to a remote computer over a network and run commands on it as if sitting at it.
    One mark for each part; a device without its reason or place is an incomplete answer.

For the file question see CSV and binary files; for the case see computer networks for Class 12.

Q3. What do I do after writing the paper?

Mark this model paper with answers, then rewrite what you lost

A sample paper helps only after it is marked. Give yourself half marks exactly where the steps name them, total each unit separately, and rewrite every lost answer the next day without looking.

A three-hour plan for 70 marks

PartMarksMinutes
Section A2130
Section B1435
Section C925
Section D1645
Section E1025
Check output spacing, colons, semicolons20
Total70180

These minutes are our teaching plan, not a CBSE rule. You may write Sections D and E first while you are fresh; keep every answer numbered and either order works.

Where your marks went

UnitOut ofIf this is the weak line
Programming 240One file program and one stack program from memory each day
Database20Four queries a day on one table, then two with a join
Networks10One case study a week and the list of full forms

Next papers: important questions by unit for the gaps, then the revision plan for the weeks to 31 March. For a list of complete programs with output, read Python programs for CBSE Class 12.

How a paper is marked with a teacher

  1. Written by hand, on your own

    The student writes a fresh paper in one sitting and sends photographs of the pages before class. Handwriting, crossed-out code and time lost are all part of the evidence.

  2. Marked on the shared screen

    Teacher and student go through it step by step. The student says why a half mark should be given; the teacher shows where the scheme would or would not give it.

  3. Typed and run as written

    The handwritten program is typed exactly as it stands and run. A missing colon or a wrong file mode shows itself, and the student fixes it.

  4. One weak line chosen

    The unit that lost most becomes the work until the following paper, with short written questions set between classes.

One to one, at your own timing

Have your sample paper marked live, one to one

Sample paper work here is a private class between one student and one teacher, on days and at times you set. Begin with a priority demo at a slot you pick, or a free demo class; if you enrol after the priority demo, its fee is adjusted against your first month.

Before you enrol · Try a class

Priority demo, at a slot you pick

a full live class of about 45 to 60 minutes

  • Bring a written paper, or write part of this one in the class
  • A teacher marks it step by step as you watch
  • One program is run exactly as you wrote it
  • A written skill report tells you which unit to repair first
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 new 70-mark paper whenever you are ready for one
  • Your own answers marked, never a model answer read out
  • Lost half marks rewritten until they are safe
  • Classes moved around school pre-boards and practicals
Ask for a personalised plan

A student with a month or more left usually alternates: one paper, then classes on the unit it exposed. Closer to the exam the classes become almost all papers. Billing is monthly, with no admission fee, and the fee is shown in your own currency.

Studying outside India?

Sample paper practice for 083 students in any time zone

CBSE schools abroad follow the same 083 syllabus, so this paper fits a student in Muscat or Singapore as well as one in Nagpur. Class time is agreed for your evening, not ours.

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

A full paper takes three hours, so it is written at home on a free day; the live class is for marking it. Tell us your city in the form and we will suggest slots.

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 the sample paper

What students ask about the Class 12 Computer Science sample paper

Is the CBSE Class 12 Computer Science sample paper 2026-27 released?

Yes. CBSE has published the 2026-27 sample question paper and marking scheme for Computer Science (083) on its academic website, cbseacademic.nic.in. The paper has 37 questions for 70 marks and carries a note that the question paper design and assessment pattern have not changed for the 2026-27 session.

Where can I get the Class 12 Computer Science sample paper 2026-27 with solutions?

The official paper and its marking scheme are two files on cbseacademic.nic.in, in the sample question paper section for Class XII. For a second paper, this page has an original 70-mark paper in the same design with every answer worked under its question. Use the official pair first, because its step marks come from the board itself.

How many questions are in the Class 12 Computer Science paper?

The 2026-27 sample paper has 37 questions, all compulsory: 21 of one mark, seven of two marks, three of three marks, four of four marks and two of five marks. That adds up to 70 marks in three hours. Ten questions offer an internal choice, sometimes in the whole question and sometimes in only one part.

Will the 2027 board paper be the same as the sample paper?

No. The sample paper shows the design, not the questions. Expect the same sections, marks and kinds of question, with new programs, tables and cases. That is why it helps to write several different papers in the same design, instead of learning the answers to one.

Is there a choice in the Class 12 Computer Science paper?

Yes, inside some questions. In the 2026-27 sample paper, Questions 22, 24, 25, 27, 28, 29, 31 and 32 offer A or B, Question 34 has a choice in its last part, and so does Question 37. Section A, the error correction, the stack, the CSV program, the connectivity program and the binary file program have none.

What does each section of the Class 12 Computer Science paper test?

They test different things. Section A checks reading: outputs, definitions and single queries. Sections B and C ask for short functions and differences. Section D is mostly SQL and connectivity, and Section E has one file program and one network case. Section A alone is 21 of the 70 marks, so careful one-mark answers matter as much as the long programs.

Do I have to write the option text in Class 12 Computer Science MCQs?

Yes. The general instructions of the 2026-27 sample paper say that in an MCQ the text of the correct answer should also be written. So write the letter and the text, for example "(b) an alternate key". It costs a few seconds and removes any doubt about which option you meant.

How many sample papers should I solve for Class 12 Computer Science?

There is no official number. A workable plan is the official paper, this one, and then a new paper each week, as long as every paper is marked and its lost answers rewritten. Three papers that were properly marked teach more than ten that were only read.

How are Python programs marked if the output is wrong?

By steps. In the official marking scheme a program is split into parts such as the function header, opening the file in the right mode, the logic and the display, each worth half a mark or more. A program with one wrong line can still earn most of its marks, so never leave a program blank.

Is the practical part of the Class 12 Computer Science sample paper?

No. The sample paper covers the 70 theory marks only. The practical is a separate 30 marks: a lab test of 12, a report file of 7, a project of 8 and a viva of 3. CBSE has scheduled practicals for 2026-27 from 1 January 2027, and each school fixes its own day.

Can a teacher mark my sample paper live?

Yes. Modern Age Coders runs personalised one to one classes in which your handwritten paper is marked step by step on a shared screen and your programs are run as you wrote them. You can start with a priority demo, a full live class at a slot you pick with a written skill report afterwards, or with a free demo class.

Start

Start with one paper, marked while you watch

Book a priority demo at a slot you pick and bring a paper you have written, this one or the official one. In about 45 to 60 minutes the teacher marks a part of it with you, runs one of your programs, and writes a skill report that says which unit to repair first. The demo fee is adjusted against the first month if you enrol. A free demo class is there too if you only want to see how we teach.

Before you book, you may want the 083 syllabus for 2026-27 or our Class 12 Computer Science tuition page.

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