---
title: "Class 12 Computer Science Output Questions with Answers"
description: "Class 12 computer science output questions for CBSE 083: 40 original Python items with answers, trace tables, the random module method and error finding."
canonical: https://learn.modernagecoders.com/cbse-class-12-computer-science-output-questions
source: src/pages/cbse-class-12-computer-science-output-questions.html
---
> Class 12 computer science output questions for CBSE 083: 40 original Python items with answers, trace tables, the random module method and error finding.

Start here

## Courses for students who want to read code well

Tracing is a Class 11 skill that the Class 12 paper keeps testing. The first course rebuilds it inside the syllabus, the second outside it, and the third covers the output questions written in SQL.

[![Computer Science Class 11 and 12 course thumbnail](/images/ip-cs-class-11-12.webp)  Class 11 and 12 / Syllabus Computer Science 11 and 12 Sets aside time for tracing loops and counting iterations in Class 11, then functions, exceptions and files in Class 12. Open the course →](/courses/cbse-icse-computer-science-class-11-12-python-java-complete-course)[![Python for Teens course thumbnail](/images/python-teens.webp)  Python / Reading and writing Python for Teens Truth values, short-circuit logic, exceptions and collections, met first in small programs the student writes. Open the course →](/courses/python-complete-masterclass-teens)[![MySQL for Teens course thumbnail](/images/mysql-teens.webp)  SQL / Predict the rows MySQL for Teens The sample paper can ask for the output of four queries. This course teaches you to see the rows before you run them. Open the course →](/courses/mysql-mastery-for-teens)

Ans. The short version

Class 12 computer science output questions ask you to write exactly what a short Python program prints. In the CBSE 083 sample paper for 2026-27 they carry nine marks in Section A and two in Question 26, with two more for finding errors. The usual traps are scope, default and mutable arguments, None from a function, slicing steps, exceptions and the limits of randint() and randrange(). This page has 40 original items with answers. Modern Age Coders practises them live, personalised one to one at your own timing, and a priority demo lets you try a class first.

Q1. Where are they, and how do I solve one?

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

In the official 2026-27 sample paper we counted nine one-mark Python output questions, one two-mark output and one two-mark error correction: 13 of the 70 marks with no choice, and up to six more if you pick the output option in Questions 25 and 32.

| Question in the SQP | What it tests | Marks |
| --- | --- | --- |
| 1, 2, 7, 18 | list, string and dictionary behaviour | 4 |
| 5 | what happens when the code runs | 1 |
| 6 | possible output with random | 1 |
| 10 | an expression with several operators | 1 |
| 14 | what a program writes to a file | 1 |
| 16 | scope of a variable | 1 |
| 26 | a loop over a string | 2 |
| 23 | find and correct the errors | 2 |
| 25 B, 32 B | Python output, SQL output (if chosen) | 2 + 4 |

The actual 2027 paper may spread them differently. The skill is the same.

### The method, in five steps

1. #### Mark the def lines

  Nothing in a function runs until it is called. Find the first line that does run.
2. #### One column for each variable

  Add a row each time a loop turns or a call is made.
3. #### Circle every print

  Note its `end` and `sep`. They decide the spaces and the lines.
4. #### Ask the type

  7 or 7.0, '7' or 7, a list or a tuple: the brackets and quotes are part of the answer.
5. #### Check the edges

  The last value of range(), the empty case, the line after an exception.

### One worked trace

***Worked example**two marks*

```
word = "Udaipur"
code = ""
for i in range(len(word)):
    if word[i] in "aeiou":
        code += str(i)
    elif i % 2 == 0:
        code = word[i].upper() + code
    else:
        code += word[i]
print(code)
```

***Output**as run*

```
RPUd235
```

| i | word[i] | Rule that applies | code after |
| --- | --- | --- | --- |
| 0 | U | capital, not in "aeiou"; i even, to the front | U |
| 1 | d | i odd, to the end | Ud |
| 2 | a | vowel, adds 2 | Ud2 |
| 3 | i | vowel, adds 3 | Ud23 |
| 4 | p | i even, to the front | PUd23 |
| 5 | u | vowel, adds 5 | PUd235 |
| 6 | r | i even, to the front | RPUd235 |

Q2. Operators, strings, lists, dictionaries

## Find the output in Python Class 12: the one-mark items

A one-mark output tests one rule. Fourteen rules follow, seven on operators and strings and seven on lists, tuples and dictionaries.

1. Write the output.

  ***Item 1**operators*

  ```
  print(2 ** 3 ** 2 // 10 % 7, -17 // 5, -17 % 5)
  ```

  Answer**2 -4 3**** is worked from the right: 3 ** 2 is 9, 2 ** 9 is 512. Then 512 // 10 is 51 and 51 % 7 is 2. Floor division goes down to -4, and the remainder takes the sign of 5.
2. Write the output.

  ***Item 2**logic*

  ```
  print(not 4 > 3 or 5 and 0, bool("False"))
  ```

  Answer**0 True**Order: not, and, or. `not 4 > 3` is False; `5 and 0` gives 0; `False or 0` gives 0, not False. Any non-empty string is True.
3. Write the output.

  ***Item 3**slicing*

  ```
  t = "Monsoon 2027"
  print(t[2:9:2], t[-4:], t[::-3])
  ```

  Answer**non2 2027 72on**Indexes 2, 4, 6, 8 are n, o, n, 2. From the end in steps of 3: 11, 8, 5, 2, which are 7, 2, o, n.
4. Write the output.

  ***Item 4**string methods*

  ```
  s = "cricket"
  print(s.replace("c", "k", 1), s.find("k"), s.count("c"))
  ```

  Answer**kricket 4 2**replace() made a new string and only for the first c. s itself is unchanged, so k is still at index 4 and c occurs twice.
5. Write the output.

  ***Item 5**split*

  ```
  x = "red-green--blue"
  p = x.split("-")
  print(p, len(p))
  ```

  Answer**['red', 'green', '', 'blue'] 4**Two separators side by side have an empty string between them.
6. Write the output.

  ***Item 6**strings that look like numbers*

  ```
  print("Lab" * 2 + "5" * 3, "10" > "9")
  ```

  Answer**LabLab555 False**Strings are compared character by character, and "1" comes before "9".
7. Write the output.

  ***Item 7**strip and case*

  ```
  m = "  pYthon Lab "
  print(m.strip().capitalize(), len(m))
  ```

  Answer**Python lab 13**capitalize() lowers every letter after the first, so Lab becomes lab. The length still counts the three spaces at the ends and one inside.

1. Write the output.

  ***Item 8**two names, one list*

  ```
  a = [1, 2, 3]
  b = a
  c = a[:]
  a.append(4)
  b[0] = 9
  print(a, c)
  ```

  Answer**[9, 2, 3, 4] [1, 2, 3]**b is another name for the same list. c is a copy made by the slice, before the changes.
2. Write the output.

  ***Item 9**sort*

  ```
  L = [5, 3, 8]
  print(L.sort(), L)
  ```

  Answer**None [3, 5, 8]**sort() changes the list and returns None. sorted(L) would return a new list.
3. Write the output.

  ***Item 10**removing while looping*

  ```
  nums = [2, 4, 6, 7, 8]
  for x in nums:
      if x % 2 == 0:
          nums.remove(x)
  print(nums)
  ```

  Answer**[4, 7]**After 2 is removed everything shifts left, and index 1 is now 6. After 6 goes, index 2 is 8. So 4 is never looked at, and it stays though it is even.
4. Write the output.

  ***Item 11**append or extend*

  ```
  p = [1]
  p.append([2, 3])
  p.extend([4, 5])
  print(p, len(p))
  ```

  Answer**[1, [2, 3], 4, 5] 4**append() adds one item, whatever it is. extend() adds each item of the list.
5. Write the output.

  ***Item 12**list inside a tuple*

  ```
  t = (4, [5, 6])
  t[1].append(7)
  print(t, len(t))
  ```

  Answer**(4, [5, 6, 7]) 2**The tuple still holds the same two objects. `t[0] = 1` would be a TypeError.
6. Write the output.

  ***Item 13**dictionary get*

  ```
  d = {}
  for w in ["ab", "c", "de", "c"]:
      d[len(w)] = d.get(len(w), "") + w
  print(d)
  ```

  Answer**{2: 'abde', 1: 'cc'}**The keys are lengths. Key 2 was made first, so it prints first; a dictionary keeps the order of insertion.
7. Write the output.

  ***Item 14**dictionary order*

  ```
  d = {3: "c", 1: "a"}
  d[2] = "b"
  d[3] = "z"
  print(list(d), d.pop(1), len(d))
  ```

  Answer**[3, 1, 2] a 2**Changing the value of key 3 does not move it. The list is built before pop() runs, and len() after.

More one-mark practice, with options and assertion-reason items, is in [the Class 12 CS MCQ test](/cbse-class-12-computer-science-mcq-test).

Q3. Functions

## Predict the output, Class 12 Python functions and scope

In a function question, write the parameters as fresh variables and ask two things: is the value changed in place or replaced, and what is returned?

1. Write the output.

  ***Item 15**default values*

  ```
  def park(hours, rate=20, fixed=10):
      return fixed + hours * rate

  print(park(2), park(2, 5), park(2, 5, 0))
  ```

  Answer**50 20 10**Arguments fill from the left. The second call replaces rate only; the third replaces both defaults.
2. Write the output.

  ***Item 16**local and global*

  ```
  fuel = 50
  def drive(km):
      fuel = 40
      fuel -= km
      return fuel
  def refill(n):
      global fuel
      fuel += n
      return fuel
  print(drive(15), fuel, refill(5), fuel)
  ```

  Answer**25 50 55 55**drive() works on its own fuel. refill() changes the outer one. print evaluates its arguments left to right, so the second item is read before refill runs.
3. What happens?

  ***Item 17**read before assignment*

  ```
  score = 12
  def bonus():
      print(score)
      score = 20
  bonus()
  ```

  Answer**UnboundLocalError**The assignment further down makes score local to the whole function, so the print line finds it without a value. Write "Error" and the reason if the question asks what happens.
4. Write the output.

  ***Item 18**mutable argument*

  ```
  def edit(marks, n):
      marks.append(n)
      n = n * 10
      marks = [0]
      marks.append(n)
      return len(marks)

  m = [7]
  k = 5
  print(edit(m, k), m, k)
  ```

  Answer**2 [7, 5] 5**The first append reaches the list of the caller. After `marks = [0]` the name points to a new list, so the second append does not. An integer never changes outside.
5. Write the output.

  ***Item 19**no return*

  ```
  def shout(word):
      print(word.upper())

  print(shout("go"), len("go"))
  ```

  Answer**GO
  None 2**The call prints GO first. Then the outer print shows what the function returned, which is None.

1. Write the output.

  ***Item 20**default list*

  ```
  def log(item, box=[]):
      box.append(item)
      return box

  print(log("pen"))
  print(log("ink", []))
  print(log("nib"))
  ```

  Answer**['pen']
  ['ink']
  ['pen', 'nib']**The default list is made once, when def runs, and it is shared by every call that does not pass its own.
2. Write the output.

  ***Item 21**call inside a call*

  ```
  def stage(x):
      print("in", x)
      return x + 2

  print(stage(stage(1)) * 2)
  ```

  Answer**in 1
  in 3
  10**The inner call finishes first and its value, 3, becomes the argument of the outer one. 5 * 2 is 10.
3. Write the output.

  ***Item 22**two values returned*

  ```
  def turn(a, b):
      return b, a - b

  x, y = turn(9, 4)
  x, y = turn(x, y)
  print(x, y)
  ```

  Answer**5 -1**The first call gives 4 and 5. The second gets a = 4, b = 5 and gives 5 and -1.
4. Write the output.

  ***Item 23**same letters, other order*

  ```
  a, b = 3, 8
  def swap(b, a):
      a, b = b, a + b
      print(a, b)
  swap(a, b)
  print(a, b)
  ```

  Answer**3 11
  3 8**The call sends 3 to b and 8 to a. Inside, a becomes 3 and b becomes 11. The outer a and b are different variables.

If items 16 to 18 went wrong, the notes on parameters and scope are in [functions in Python for Class 12](/cbse-class-12-computer-science-functions).

Q4. Loops, exceptions, stack and files

## Output based questions for Class 12 Computer Science: following control

These programs jump. Trace the order of lines first and the values second.

1. Write the output.

  ***Item 24**nested loops*

  ```
  x, total = 5, 0
  while x > 1:
      for k in range(1, x, 2):
          total += k
      print(x, total, end=" | ")
      x -= 2
  print(x)
  ```

  Answer**5 4 | 3 5 | 1**The inner loop stops before x.

  | x | k takes | total | Printed |
  | --- | --- | --- | --- |
  | 5 | 1, 3 | 4 | 5 4 \| |
  | 3 | 1 | 5 | 3 5 \| |
  | 1 | loop ends | 5 | 1 |
2. Write the output.

  ***Item 25**two-mark string*

  ```
  route = "NH44-Km9"
  new = ""
  for ch in route:
      if ch.isupper():
          new += ch.lower()
      elif ch.isdigit():
          new += str(int(ch) + 1)
      elif ch.isalpha():
          new = ch.upper() + new
      else:
          new += "/"
  print(new)
  ```

  Answer**Mnh55/k10**Only m reaches the isalpha branch, and it goes to the front.

  | ch | Branch | new |
  | --- | --- | --- |
  | N, H | upper | nh |
  | 4, 4 | digit | nh55 |
  | - | else | nh55/ |
  | K | upper | nh55/k |
  | m | alpha | Mnh55/k |
  | 9 | digit | Mnh55/k10 |
3. Write the output.

  ***Item 26**dictionary of lists*

  ```
  stock = {"A": [3, 0], "B": [1, 4], "C": [0, 0]}
  for k in stock:
      if sum(stock[k]) == 0:
          continue
      print(k * len(stock[k]), max(stock[k]), sep=":")
  ```

  Answer**AA:3
  BB:4**C is skipped. The key is repeated once for each item in its list, and sep replaces the space.
4. Write the output.

  ***Item 27**stack in a list*

  ```
  st = []
  for x in [5, 12, 7, 20, 9]:
      if x > 10 and st:
          st[-1] += x
      else:
          st.append(x)
  print(st.pop(), st)
  ```

  Answer**9 [17, 27]**12 is added to the top, 5, making 17. 7 is pushed, then 20 makes it 27. 9 is pushed and popped. pop() runs before the list is shown.

1. Write the output.

  ***Item 28**several excepts*

  ```
  for v in [4, "2", 0, 8]:
      try:
          print(8 // v, end=" ")
      except ZeroDivisionError:
          print("zero", end=" ")
      except TypeError:
          print("type", end=" ")
      finally:
          print("*", end=" ")
  ```

  Answer**2 * type * zero * 1 ***finally runs in every pass. 8 // "2" is a TypeError, since the string is not converted for you.
2. Write the output.

  ***Item 29**return and finally*

  ```
  def read(text):
      try:
          return int(text)
      except ValueError:
          return -1
      finally:
          print("read", text)

  print(read("15") + read("1.5"))
  ```

  Answer**read 15
  read 1.5
  14**The finally block prints before each value is handed back. int("1.5") is a ValueError, so the second value is -1.
3. Write the output.

  ***Item 30**where control goes*

  ```
  try:
      print("A")
      L = [1, 2]
      print(L[2])
      print("B")
  except IndexError:
      print("C")
  print("D")
  ```

  Answer**A
  C
  D**Control leaves the try block at the failing line and does not come back, so B is never printed.
4. Write the output.

  ***Item 31**file pointer*

  ```
  with open("tag.txt", "w+") as f:
      f.write("Kaziranga")
      f.seek(4)
      print(f.read(3), f.tell())
      f.seek(0)
      print(f.read()[::-2])
  ```

  Answer**ran 7
  anrzK**Position 4 is r, and three characters take the pointer to 7. The last line reads all nine letters and steps back by two.

For more like these, read [exception handling](/cbse-class-12-computer-science-exception-handling), [text files with seek and tell](/cbse-class-12-computer-science-file-handling) and [the stack](/cbse-class-12-computer-science-stack).

Q5. The random module

## Random module output questions Class 12: list every case, then choose

A possible-output question is solved by listing all the values each random call can give, and striking out every option that needs another value.

| Call | Can give | Cannot give |
| --- | --- | --- |
| `random.randint(2, 5)` | 2, 3, 4, 5 | 6 |
| `random.randrange(2, 5)` | 2, 3, 4 | 5 |
| `random.randrange(5)` | 0, 1, 2, 3, 4 | 5 |
| `random.randrange(1, 8, 3)` | 1, 4, 7 | 8, or anything between |
| `random.random()` | 0 up to just below 1 | 1 |

- **Called once or every time?** Before the loop, one value serves all passes. Inside the loop, each pass has its own.
- **Start from what must be there.** Find the first item or the last item that appears in every output. It usually removes two options.
- **Largest and smallest.** If the question asks for them, put the extreme values in, after checking that a larger random number really gives a larger result.

1. Which output is possible?

  ***Item 32**random*

  ```
  import random
  bay = ["Kochi", "Goa", "Puri", "Diu", "Vizag"]
  size = random.randint(1, 3)
  for i in range(size):
      print(bay[i], end="*")
  ```

  (a) `Kochi*Goa*Puri*Diu*`
  (b) `Goa*Puri*`
  (c) `Kochi*Goa*`
  (d) `Kochi*Vizag*`

  Answer**(c) Kochi*Goa***. size is 1, 2 or 3, and the loop always begins at index 0. The three possible outputs are Kochi*, Kochi*Goa* and Kochi*Goa*Puri*.
2. Which output is possible? Also give the shortest and the longest one.

  ***Item 33**random*

  ```
  import random
  w = "JASMINE"
  a = random.randrange(1, 4)
  b = random.randint(4, 5)
  print(w[a:b])
  ```

  (a) `JASM`
  (b) `SMI`
  (c) `ASMIN`
  (d) `MINE`

  Answer**(b) SMI**. The shortest is M and the longest ASMI.

  | a | b = 4 | b = 5 |
  | --- | --- | --- |
  | 1 | ASM | ASMI |
  | 2 | SM | SMI |
  | 3 | M | MI |
3. Which value can be printed? Give the least and the greatest.

  ***Item 34**random*

  ```
  import random
  x = 10 * random.randint(1, 3) + random.randrange(5, 8)
  print(x)
  ```

  (a) `18`
  (b) `27`
  (c) `38`
  (d) `30`

  Answer**(b) 27**. The tens part is 10, 20 or 30 and the units part 5, 6 or 7. The least value is 15 and the greatest 37.

1. Which output is possible?

  ***Item 35**random*

  ```
  import random
  size = random.randint(2, 4)
  for k in range(size, 0, -1):
      print(k * 2, end="<")
  ```

  (a) `2<4<6<`
  (b) `8<6<4<`
  (c) `6<4<2<`
  (d) `4<2<0<`

  Answer**(c) 6<4<2<**. The loop counts down and always ends with k = 1, so every output ends in 2<. Possible: 4<2<, 6<4<2< and 8<6<4<2<.
2. What is the least and the greatest number of # signs?

  ***Item 36**random*

  ```
  import random
  size = int(random.random() * 4) + 3
  print("#" * size)
  ```

  Answer**Least 3, greatest 6.** random() is at least 0 and always less than 1, so int(random.random() * 4) is 0, 1, 2 or 3. It can never be 4.
3. Which output is NOT possible?

  ***Item 37**random*

  ```
  import random
  p = ["Ram", "Sia", "Tej", "Uma"]
  for i in range(3):
      print(p[random.randrange(0, 2) + i], end="-")
  ```

  (a) `Ram-Sia-Tej-`
  (b) `Sia-Sia-Uma-`
  (c) `Sia-Tej-Tej-`
  (d) `Ram-Uma-Tej-`

  Answer**(d) Ram-Uma-Tej-**. randrange(0, 2) is called again in each pass and gives 0 or 1. The first name is Ram or Sia, the second Sia or Tej, the third Tej or Uma. Eight outputs are possible; Uma in second place is not.

Q6. Find the error

## How do you find and correct errors in a Python program?

Read the program three times: once for punctuation, once for names and case, once for sense. The sample paper gives half a mark for each of four corrections, and asks you to underline them.

1. It should say how far a student is from 75.

  ***Item 38**wrong on purpose*

  ```
  def result(marks=40, name):
      if marks => 75
          print(name, "has passed")
      else:
          print(name, 75 - marks "short")

  result(62, "Ira")
  ```

  Answer (1) The default parameter must come last, so the call changes order too. (2) The operator is >=. (3) Colon after the condition. (4) Comma before "short".

  ***Item 38**corrected*

  ```
  def result(name, marks=40):
      if marks >= 75:
          print(name, "has passed")
      else:
          print(name, 75 - marks, "short")

  result("Ira", 62)
  ```

  ***Output**as run*

  ```
  Ira 13 short
  ```
2. It should count each word.

  ***Item 39**wrong on purpose*

  ```
  def tally(words)
      d = {}
      for w in words:
          if w in d:
              d[w] =+ 1
          else:
              d[w] = 1
      return D

  print(tally["sun", "fog", "sun"])
  ```

  Answer (1) Colon after def. (2) += adds; =+ 1 only stores positive one. (3) d, not D. (4) A call needs round brackets around the list.

  ***Item 39**corrected*

  ```
  def tally(words):
      d = {}
      for w in words:
          if w in d:
              d[w] += 1
          else:
              d[w] = 1
      return d

  print(tally(["sun", "fog", "sun"]))
  ```

  ***Output**as run*

  ```
  {'sun': 2, 'fog': 1}
  ```

1. It should reverse the digits of a number.

  ***Item 40**wrong on purpose*

  ```
  num = input("Number: ")
  rev = 0
  while num > 0:
      digit = num // 10
      rev = rev * 10 + digit
      num = num % 10
  print("Reverse is" + rev)
  ```

  Answer (1) int() around input(). (2) The last digit is num % 10. (3) Dropping it is num // 10. (4) A number cannot be joined to a string with +; use a comma.

  ***Item 40**corrected*

  ```
  num = int(input("Number: "))
  rev = 0
  while num > 0:
      digit = num % 10
      rev = rev * 10 + digit
      num = num // 10
  print("Reverse is", rev)
  ```

  ***Output**as run*

  ```
  Number: 472
  Reverse is 274
  ```

### What your wrong answer tells you

| You lost marks on | Revise |
| --- | --- |
| 1 to 7 | operator order, slicing, what a string method returns |
| 8 to 14 | which methods change a list and which return a new one |
| 15 to 23 | scope, default values, None |
| 24 to 31 | the order in which lines run |
| 32 to 37 | the end points of the random calls |
| 38 to 40 | reading slowly |

### Spoken tracing

In a class the student talks through the table row by row. The teacher hears the exact line where the idea slips.

### Changed by one line

After each item one thing is altered, a step, a default, an indent, and you predict again. That is how a rule is tested properly.

### Ten items against a clock

Short timed sets from mixed topics, written by hand, so that speed arrives without losing the brackets.

When forty items feel comfortable, sit [a full 70-mark practice paper](/cbse-class-12-computer-science-sample-paper-2026-27). For longer programs to trace, use [20 Python programs for CBSE Class 12](/blog/python-programs-for-cbse-class-12).

One to one, at your own timing

## Somebody should watch you trace

A wrong output shows that something slipped. Only a teacher beside you can see where. So this practice is personalised one to one, on your days and at your time. Take a priority demo to see it work, one full live class whose fee is set against your first month if you enrol, or a free demo class if you want only a taste. The fee is monthly, admission costs nothing, and you can leave at any month end.

Before you enrol · Try a class

### Priority demo, at a slot you pick

a full live class of about 45 to 60 minutes

- A short mixed set solved by you, aloud and on paper
- The rule behind each slip named and tried on a fresh program
- One random module question listed case by case
- A written skill report that sorts your errors by kind

[Book a priority demo](/book-demo)

The classes · Choose your own timing

### Personalised one to one

₹4,999

per month, 4 private classes, fully flexible timing

- Items chosen from the families you get wrong
- Class 11 Python repaired where a Class 12 question exposes it
- Functions, files and stack written as well as read
- SQL output and networks brought in before the pre-boards

Ask for a personalised plan

Output practice works in small, regular doses, so it is usually a part of each class and not the whole of it. The rest of the hour goes to writing programs, where more of the marks are. The monthly fee is on this page in your currency.

Studying outside India?

## Output question practice for 083 students abroad

From Muscat to Kathmandu, CBSE students trace the same Python. Say which evenings are free and the sessions sit there.

| Where you live | Time difference | Usual class window, local time | Format |
| --- | --- | --- | --- |
| India every Indian city | Indian time | Any time you choose | Personalised 1-on-1 |
| UAE and Oman Dubai, Abu Dhabi, Sharjah, Muscat | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Saudi Arabia, Qatar, Kuwait, Bahrain Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama | 2 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Nepal Kathmandu | 15 min ahead of India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Ethiopia and East Africa Addis Ababa and East Africa Time | 2 h 30 min behind India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore and Malaysia Singapore, Kuala Lumpur | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |

Keep paper and a pen at the desk. The editor stays closed until you have written an answer, in class as in the exam hall.

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.

### Practicals, project and viva

- [Class 12 CS viva questions](/cbse-class-12-computer-science-viva-questions)
- [Class 12 CS project with source code](/cbse-class-12-computer-science-project-python-mysql)
- [Class 12 CS project topics](/cbse-class-12-computer-science-project-topics)

### Exam, papers and marks

- [Class 12 CS sample paper practice](/cbse-class-12-computer-science-sample-paper-2026-27)
- [Class 12 CS exam date, pattern and marks](/cbse-class-12-computer-science-paper-pattern-and-marking-scheme)
- [Class 12 CS important questions](/cbse-class-12-computer-science-important-questions)

### Questions and practice

- [Class 12 CS MCQ test](/cbse-class-12-computer-science-mcq-test)
- [Class 12 CS case study questions](/cbse-class-12-computer-science-case-study-questions)
- [Class 12 CS SQL questions](/cbse-class-12-computer-science-sql-queries)

### Chapter by chapter

- [Functions in Python Class 12](/cbse-class-12-computer-science-functions)
- [Exception handling Class 12](/cbse-class-12-computer-science-exception-handling)
- [Text file handling Class 12](/cbse-class-12-computer-science-file-handling)
- [CSV and binary files Class 12](/cbse-class-12-computer-science-csv-and-binary-files)
- [Stack Class 12 Computer Science](/cbse-class-12-computer-science-stack)
- [Computer networks Class 12](/cbse-class-12-computer-science-computer-networks)
- [Python MySQL connectivity Class 12](/cbse-class-12-computer-science-python-mysql-connectivity)

### Notes, revision and help

- [Class 12 CS syllabus 2026-27](/cbse-class-12-computer-science-syllabus-2026-27)
- [Class 12 CS notes](/cbse-class-12-computer-science-notes)
- [Class 12 CS revision plan](/cbse-class-12-computer-science-revision-plan)
- [Class 12 CS crash course](/cbse-class-12-computer-science-crash-course)

**CBSE Class 12 Informatics Practices (065):** [Class 12 IP practical file](/cbse-class-12-informatics-practices-practical-file)  [Class 12 IP project with source code](/cbse-class-12-informatics-practices-project)  [Class 12 IP sample paper practice](/cbse-class-12-informatics-practices-sample-paper-2026-27)  [Class 12 IP important questions](/cbse-class-12-informatics-practices-important-questions)

**CBSE Class 12 Information Technology (802):** [IT 802 practical and project file](/cbse-class-12-it-802-practical-and-project-file)  [IT 802 Java notes and programs](/cbse-class-12-it-802-java-programs)  [IT 802 notes](/cbse-class-12-it-802-notes)

**CBSE Class 11 CS, IP and AI:** [Class 11 CS practical file](/cbse-class-11-computer-science-practical-file)  [Class 11 IP practical file](/cbse-class-11-informatics-practices-practical-file)  [CS or IP in Class 11](/computer-science-or-informatics-practices-class-11)

**ISC Computer Science (868):** [ISC Class 12 CS syllabus 2027](/isc-class-12-computer-science-syllabus-2027)  [ISC Class 12 CS practice paper](/isc-class-12-computer-science-specimen-paper-practice)  [ISC Class 12 practical questions solved](/isc-class-12-computer-science-practical-questions)  [ISC Boolean algebra and K-maps](/isc-class-12-computer-science-boolean-algebra)

**Program lists with output:** [Class 12 CS practical file](/blog/python-practical-file-class-12)  [20 Python programs for Class 12](/blog/python-programs-for-cbse-class-12)  [Menu-driven programs in Python](/blog/how-to-build-menu-driven-program-in-python)

Questions about output questions

## What students ask about find-the-output questions

### How many marks are output questions in Class 12 Computer Science?

CBSE fixes no number. By our count of the 2026-27 sample paper, Python output questions take nine marks in Section A and two in Question 26, and Question 23 gives two for correcting errors. Choosing the output options in Questions 25 and 32 would add six more.

### How do I solve find the output questions in Python quickly?

Find the first line that runs, make one column per variable, and write a row for each turn of the loop. Note the end and sep of every print. Most slips come from skipping the table to save time. With practice a two-mark trace takes three or four minutes.

### How do I solve random module output questions in Class 12?

Write the full list of values each random call can give, remembering that randint() includes both ends and randrange() leaves out the second. Work out the output for each combination, or for the extremes if there are many, and strike out the options that cannot occur.

### What is the difference between randint() and randrange()?

randint(a, b) can return any whole number from a to b, including b. randrange(a, b) stops before b, and it accepts a step, so randrange(1, 8, 3) gives 1, 4 or 7. random() returns a decimal from 0 up to, but not including, 1.

### Why does my Python function print None?

Because it has no return statement and its call is inside print(). The function does its own printing, then hands back None, and the outer print shows it. Either call the function without print(), or return the value instead of printing it.

### What should I write if the code gives an error?

Write "Error" with its name if you know it, and the line and reason in a few words, such as "UnboundLocalError: score is local and used before it has a value". If some lines print before the failing line, write that output as well.

### Do spaces and brackets matter in output answers?

Yes, they show that you know the type and the separator. A list needs its square brackets and quotes round its strings, a tuple its round ones, and print() puts a space between items unless sep says otherwise. True and False begin with capitals.

### What kind of errors are in error finding questions?

Missing colons and brackets, wrong case in a keyword or a name, = where == is meant, a wrong operator, a missing conversion, wrong limits in range(), and one or two logical errors where the program runs but gives the wrong result. Underline every correction you make.

### Is recursion asked in Class 12 output questions?

No. Recursion is not in the 083 Class 12 syllabus for 2026-27, and neither are queues or linked lists. Output questions come from the Class 11 topics in revision, functions and scope, exceptions, files and the stack.

### Are output questions asked from SQL also?

Yes. In the 2026-27 sample paper, part B of Question 32 gives four queries and asks for their output, one mark each. It is an internal choice: part A asks you to write the queries. This page is about Python; SQL outputs have a page of their own.

### Can I practise output questions with a teacher online?

Yes, live and personalised one to one, at days and times you choose. You can try a priority demo first: a full class of about 45 to 60 minutes, a written skill report afterwards, and the fee adjusted against the first month if you enrol. A free demo class is also open.

Start

## Trace five programs with a teacher

For the free demo class, pick any five items from this page that you were unsure of. You trace, the teacher listens, and the rule you were missing is named.

A **priority demo** gives you a full class at your chosen slot: a mixed set, one error question, one random question and a written skill report that lists the kinds of mistake you make. Its fee is adjusted against the first month when you enrol.

Ready for queries? [Class 12 SQL questions with outputs](/cbse-class-12-computer-science-sql-queries) come next.

[WhatsApp us](https://wa.me/919123366161?text=Hello%20Modern%20Age%20Coders.%20I%20want%20one%20to%20one%20practice%20of%20Python%20output%20questions%20for%20CBSE%20Class%2012%20Computer%20Science%20083.) · [+91 91233 66161](tel:+919123366161) · [connect@modernagecoders.com](mailto:connect@modernagecoders.com)

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

### 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](/book-demo)

## Keep exploring Modern Age Coders

### By class and age

- [Class 12 IP Computer Networks Notes: Unit 3 for 2026-27](/cbse-class-12-informatics-practices-computer-networks)
- [Number System Class 11 Computer Science: Conversions, Logic](/cbse-class-11-number-system-conversion)
- [Class 12 IP Crash Course 2027: Live One to One Classes](/cbse-class-12-informatics-practices-crash-course)
- [Class 11 IP Sample Paper 2026-27 With Solution, 70 Marks](/cbse-class-11-informatics-practices-sample-paper)
- [DataFrame Class 12 IP: Notes, loc and iloc, Programs](/cbse-class-12-informatics-practices-dataframe)
- [Class 11 IP Notes 2026-27: All Four Units, With Code](/cbse-class-11-informatics-practices-notes)
- [CBSE Computational Thinking for Classes 3-5](/cbse-computational-thinking-classes-3-to-5)
- [Coding for Class 3: Scratch, Block Coding & First Python for 8 Year Olds](/coding-for-class-3)
- [Class 11 Computer Science Project in Python, with Topics](/cbse-class-11-computer-science-project)

### Learn more

- [AP Computer Science A Practice Questions, With Answers](/ap-computer-science-a-practice-questions)
- [Cambridge IGCSE Computer Science Tuition](/cambridge-igcse-computer-science-tuition)
- [IB Computer Science Tutor in Peru: Live Online, SL and HL](/ib-computer-science-tutor-peru)
- [AI and Python Classes for Teens in Fredericton, NB](/ai-and-python-classes-for-teens-in-fredericton)

### Free resources

- [JavaScript Tutorial: Build Interactive Websites](/resources/javascript)
- [CSS Animations with Keyframes](/resources/html-and-css/css-animations-and-keyframes)
- [Creating and Removing DOM Elements](/resources/javascript/creating-and-removing-elements)
- [HTML Document Structure and Boilerplate](/resources/html-and-css/html-structure-and-boilerplate)

### From the blog

- [Python Programs for Class 11 CBSE (CS and IP) With Output](/blog/python-programs-for-class-11)
- [Java Constructors Explained: Types, Overloading, ICSE](/blog/java-constructors-explained)
- [Java Programs for ISC Class 11 and 12 (Solved, 2026)](/blog/java-programs-for-isc-class-11-and-12)

### Start here

- [Try a free trial class with a Modern Age Coders mentor](/free-trial)
- [About Modern Age Coders, teaching since 2020](/about)

---

*Canonical: https://learn.modernagecoders.com/cbse-class-12-computer-science-output-questions*
