Python Revision Tour Class 12 PYQs 2024–2026 with Solutions | CBSE Computer Science Skip to content
Smart Notes for Every Exam · instant PDF download after payment +91 92520 37565
Class 12 · Computer Science · Chapter 1

Python Revision Tour: Class 12 PYQs 2024–2026 with solutions

All 31 CBSE board questions asked from Python Revision Tour in 3 board papers, with the year, set and marks of each. 16 are solved free below. The Class 12 Computer Science PYQ Book: Solved Board Papers 2024-2026 (CBSE) has every solution, all chapters and 3 full board papers.

Cover of Class 12 Computer Science PYQ Book: Solved Board Papers 2024-2026 (CBSE)
Class 12 Computer Science PYQ book: every chapter + 3 board papers, all solved
US$1.99US$1.9934% off
Free sample

Python Revision Tour: board weightage

Board weightage 2024–2026

Year202420252026
Questions91111
Marks131313

Most asked topics

Tokens, operators and expressions8
Strings8
Python revision6
Lists4
Dictionaries3
Tuples1
Flow of control1

31 questions from 3 papers. Repeated questions are shown once with every year they were asked.

Jump to: 1 mark2 marks3 marks

1 mark: MCQ and Assertion–Reason

Q1 · CBSE 2026 · 91 · Q11 mark

State True or False: In Python, data type of 74 is same as the data type of 74.0.

Solution

False. type(74) is int; type(74.0) is float.

Q2 · CBSE 2026 · 91 · Q21 mark

s = "the Truth"; print(s.capitalize()) (A) The truth (B) THE TRUTH (C) The Truth (D) the Truth

Solution

(A) The truth. capitalize() makes the first character upper case and all others lower case.

Q3 · CBSE 2026 · 91 · Q31 mark

Which expression evaluates to True? (A) 2>3 and 2<3 (B) 3>1 and 2 (C) 3>1 and 3>2 (D) 3>1 and 3<2

Solution

(C). True and True → True. (A) and (D) give False; (B) gives 2 (and returns its last operand), which is truthy but not the value True, so the scheme also accepted (B).

Q4 · CBSE 2026 · 91 · Q41 mark

s='War and Peace by Leo Tolstoy'; print(s.partition("by"))

Solution

(A) ('War and Peace ', 'by', ' Leo Tolstoy'). partition() returns a tuple of three parts: before the separator, the separator, after it (spaces kept).

Q5 · CBSE 2026 · 91 · Q51 mark

What will be the output of print("PythonProgram"[-1:2:-2])?

Solution

Step −2 from index −1 (= 12, 'm') down to index 3 (excluded): indices 12, 10, 8, 6, 4 → 'm','r','o','P','o'. Output: mroPo.

Q6 · CBSE 2026 · 91 · Q61 mark

t = tuple('tuple'); t2 = t[2],; t += t2; print(t)

Solution

(C) ('t', 'u', 'p', 'l', 'e', 'p'). tuple('tuple') splits the string into characters; t[2], is the one-element tuple ('p',); += creates a new, longer tuple.

Q7 · CBSE 2026 · 91 · Q71 mark

True about dictionaries: (A) a sequence type (B) cannot have two elements with same key (C) cannot have two elements with same value (D) key and value cannot be the same

Solution

(B). Keys are unique (assigning to an existing key overwrites it). Values may repeat; a dictionary is a mapping, not a sequence.

Q8 · CBSE 2026 · 91 · Q81 mark

If L has 6 elements, which raises an exception? (A) L.pop(1) (B) L.pop(6) (C) L.insert(1,6) (D) L.insert(6,1)

Solution

(B) L.pop(6). Valid indices are 0–5, so IndexError. insert() never fails: an index beyond the end simply appends.

Q9 · CBSE 2026 · 91 · Q201 mark

A–R. (A): [1,2,3]+'123' is invalid. (R): a list cannot be concatenated with a string.

Solution

(A) Both true; R is the correct explanation (TypeError: can only concatenate list to list).

Q10 · CBSE 2025 · 91 · Q11 mark

State True or False: "A Python List must always contain all its elements of same data type."

Solution

False. A list can hold elements of different types, e.g. [1, "a", 2.5, [3]].

Q11 · CBSE 2025 · 91 · Q21 mark

What will be the output of print(14%3**2*4)? (A) 16 (B) 64 (C) 20 (D) 256

Solution

(C) 20. ** has the highest precedence: 3**2 = 9. Then % and * from left to right: 14 % 9 = 5; 5 * 4 = 20.

Q12 · CBSE 2025 · 91 · Q31 mark

Identify the correct output: game="Olympic2024"; print(game.index("C")) (A) 0 (B) 6 (C) −1 (D) ValueError

Solution

(D) ValueError. There is a lowercase "c" at index 6 but no uppercase "C"; index() raises ValueError when the substring is absent (find() would return −1).

Q13 · CBSE 2025 · 91 · Q41 mark

Which is the correct identifier? (A) global (B) Break (C) def (D) with

Full step-by-step solution is in the PYQ book (US$1.99).
Q14 · CBSE 2025 · 91 · Q51 mark

Identify the invalid statement: (A) print("A",10,end="*") (B) print("A",sep="*",10) (C) print("A",10,sep="*") (D) print("A"*10)

Full step-by-step solution is in the PYQ book (US$1.99).
Q15 · CBSE 2025 · 91 · Q61 mark

L=['TIC','TAC']; print(L[::-1]) (A) ['CIT','CAT'] (B) ['TIC','TAC'] (C) ['CAT','CIT'] (D) ['TAC','TIC']

Full step-by-step solution is in the PYQ book (US$1.99).
Q16 · CBSE 2025 · 91 · Q71 mark

Which operator evaluates to True if the variables on either side point to the same memory location? (A) is (B) is not (C) and (D) or

Full step-by-step solution is in the PYQ book (US$1.99).
Q17 · CBSE 2025 · 91 · Q81 mark

D={'S01':95,'S02':96}
for I in D: print(I,end='#') (A) S01#S02# (B) 95#96# (C) S01,95#S02,96# (D) S01#95#S02#96#

Full step-by-step solution is in the PYQ book (US$1.99).
Q18 · CBSE 2025 · 91 · Q121 mark

Which built-in function/method returns a dictionary? (A) dict() (B) keys() (C) values() (D) items()

Full step-by-step solution is in the PYQ book (US$1.99).
Q19 · CBSE 2024 · 91 · Q31 mark

Output of print(16*5/4*2/5-8): (a) −3.33 (b) 6.0 (c) 0.0 (d) −13.33

Full step-by-step solution is in the PYQ book (US$1.99).
Q20 · CBSE 2024 · 91 · Q71 mark

Identify the invalid statement: (a) d = dict() (b) e = {} (c) f = [] (d) g = dict{}

Full step-by-step solution is in the PYQ book (US$1.99).
Q21 · CBSE 2024 · 91 · Q81 mark

myStr = "MISSISSIPPI"; print(myStr[:4]+"#"+myStr[-5:]) (a) MISSI#SIPPI (b) MISS#SIPPI (c) MISS#IPPIS (d) MISSI#IPPIS

Full step-by-step solution is in the PYQ book (US$1.99).
Q22 · CBSE 2024 · 91 · Q91 mark

Which statement will raise an error? (a) print("A"*3) (b) print(5*3) (c) print("15" + 3) (d) print("15" + "13")

Full step-by-step solution is in the PYQ book (US$1.99).
Q23 · CBSE 2024 · 91 · Q101 mark

event="G20 Presidency@2023"; L=event.split(' '); print(L[::-2]) (a) 'G20' (b) ['Presidency@2023'] (c) ['G20'] (d) 'Presidency@2023'

Full step-by-step solution is in the PYQ book (US$1.99).
Q24 · CBSE 2024 · 91 · Q181 mark

A–R. (A): "Hello".sort() will give an error. (R): sort() does not exist as a method for strings.

Full step-by-step solution is in the PYQ book (US$1.99).

2 marks: very short answer

Q25 · CBSE 2026 · 91 · Q232 marks

Write a statement (built-in functions/methods only): (i) to create a new list L1 with the elements of L in ascending order, without modifying L; (ii) to check whether the character ch is an alphabet or a number.

Solution

(i) L1 = sorted(L) (sorted returns a new list; L.sort() would change L). (ii) ch.isalnum() (or ch.isalpha() or ch.isdigit()).

Q26 · CBSE 2026 · 91 · Q242 marks

Assuming D1 is a dictionary: (i)(a) Expression to check if key 'RNo' is present. OR (b) Check if any key in D1 has value 12. (ii)(a) A single built-in statement to add 'RNo':12 if 'RNo' is absent, but return its value if present. OR (b) Delete all elements of D1.

Solution

(i)(a) 'RNo' in D1  (b) 12 in D1.values()
(ii)(a) D1.setdefault('RNo', 12)  (b) D1.clear()

Q27 · CBSE 2025 · 91 · Q232 marks

Write one example each of (i) Syntax Error (ii) Implicit type conversion.

Solution

(i) print(2 ; 5) or if x>5 print(x) (missing colon): the program does not run.
(ii) x = 10; y = 20.5; print(x + y) → 30.5: the int 10 is converted to float automatically.

Q28 · CBSE 2025 · 91 · Q242 marks

D={"Suman":40, "Raj":55, "Raman":60}; D1={"Aditi":30, "Amit":90, "Raj":20} (built-in functions only).
(i)(a) Display the value for key "Raj" in D. OR (b) Display the length of D1.
(ii)(a) Append all pairs of D to D1. OR (b) Delete the item with key "Amit" from D1.

Full step-by-step solution is in the PYQ book (US$1.99).
Q29 · CBSE 2024 · 91 · Q222 marks

Output: LS=["HIMALAYA","NILGIRI","ALASKA","ALPS"]; D={}
for S in LS: if len(S)%4==0: D[S]=len(S)
for K in D: print(K,D[K],sep="#")

Full step-by-step solution is in the PYQ book (US$1.99).
Q30 · CBSE 2024 · 91 · Q232 marks

(A) (i) Remove the item with key "NISHA" from dictionary Students. (ii) Display the number of occurrences of "is" in string message. OR (B) Convert tuple subject to a list and delete its last element.

Full step-by-step solution is in the PYQ book (US$1.99).

3 marks: short answer

Q31 · CBSE 2024 · 91 · Q263 marks

Output: S="Racecar Car Radar"; L=S.split()
for W in L: x=W.upper()
  if x==x[::-1]: for I in x: print(I,end="*")
  else: for I in W: print(I,end="#")
  print()

Solution

"RACECAR" is a palindrome → printed in upper case with *. "CAR" is not → original "Car" with #. "RADAR" is a palindrome → *.

R*A*C*E*C*A*R*
C#a#r#
R*A*D*A*R*

Get every solution for all chapters

  • Every board question of every chapter, each fully solved the way the board gives marks
  • 3 complete board papers, each followed by its solutions
  • Weightage and most-asked topics for every chapter
  • Instant PDF download, colour and black & white print copies
See real pages (free sample)

Revising the chapter first? Complete Computer Science Notes for Class 12 (CBSE 083, 2026-27) →

What you get in the pack

All chapters in this pack

  1. PYQ Ch 1 Python Revision Tour
  2. PYQ Ch 2 Functions
  3. PYQ Ch 3 Exception Handling
  4. PYQ Ch 4 Text Files
  5. PYQ Ch 5 Binary Files
  6. PYQ Ch 6 CSV Files
  7. PYQ Ch 7 Stack
  8. PYQ Ch 8 Computer Networks I: Evolution and Data Communication
  9. PYQ Ch 9 Computer Networks II: Devices, Topologies and Types
  10. PYQ Ch 10 Network Protocols and Web Services
  11. PYQ Ch 11 Database Concepts
  12. PYQ Ch 12 SQL: DDL, DML and Queries
  13. PYQ Ch 13 SQL: Aggregates, Grouping and Joins
  14. PYQ Ch 14 Interface of Python with MySQL
  15. Board Paper 2026 Set 91 with Solutions
  16. Board Paper 2025 Set 91 with Solutions
  17. Board Paper 2024 Set 91 with Solutions
PYQ Ch 2 Functions →

Prices shown in US dollars. Show prices in: ₹ INR · US$ USD