Class XI & XII Computer Science: Python

12th Computer Science Periodic Test 1 2026 – 27: St. Margaret School, Rohini, New Delhi

School Name: St. Margaret Sr. Sec. School, D-BLOCK, Prashant Vihar, Sector 14, Rohini, Delhi 110085
Class: XII
Subject: Computer Science (083)
Exam: Periodic Test I (2026–27)
Time: 1 Hr
Maximum Marks: 30

SECTION – A

Question 01: Identify the length of the tuple shown: (1)

T = (((('a', 1), 'b', 'c'), 'd', 2), 'e', 3)
  1. 5
  2. 3
  3. 5
  4. 7

Question 02: Consider the lists A and B given and state the output of the expressions that follow: (1)

A = [5, 3, 8]
B = [A, 8, 66, 45]
print(A in B)
  1. [5, 3, 8]
  2. False
  3. Error
  4. True

Question 03: Identify the output of the following Python statements. (1)

x = [[10.0, 11.0, 12.0], [13.0, 14.0, 15.0]]
y = x[1][2]
print(y)
  1. 12.0
  2. 13.0
  3. 14.0
  4. 15.0

Question 04: Identify which component is a part of a function header in Python? (1)

  1. Module Name
  2. return Statement
  3. Actual Parameter
  4. Formal Parameter

Question 05: Write the statement to import modules to run the following Python code: (1)

print(median([1, 3, 5, 7, 9, 11, 13]))
print(mode([1, 3, 5, 7, 9, 11]))

Question 06: Consider the following function headers. Identify the correct statement. Give reason for validity as well as invalidity. (2)

  1. def correct(a=1,b=2,c):
  2. def correct(a=1,b,c=3):
  3. def correct(a=1,b=2,c=3):
  4. def correct(a=1,b,c):

Question 07: What possible output(s) are expected to be displayed on screen at the time of execution of the program from the following code? Also specify the maximum values that can be assigned to each of the variables Lower and Upper. (2)

import random
AR = [20, 30, 40, 50, 60, 70]
Lower = random.randint(1, 3)
Upper = random.randint(2, 4)

for K in range(Lower, Upper + 1):
    print(AR[K], end = "#")

Question 08: Observe the following Python code very carefully and rewrite it after removing all syntactical errors with each correction underlined. (2)

Value=30
for VAL in range(0,Value)
    If val%4==0:
        print (VAL*4)
    Elseif val%5==0:
    print (VAL+3)
    else
        print(VAL+10)

Question 09: Which of the following is a standard Python Library Function and not an exclusively list function? (2)

  1. Append()
  2. remove()
  3. pop()
  4. len()

Also support your answer by stating the usage of the function with example, with data types other than list.

SECTION – B

Question 10: Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are odd. Also call the function inside main(). (3)

Question 11: What do you understand by a user defined function in PYTHON? Also differentiate between Non-Void Function and Void Function, with the help of an appropriate example. (3)

Question 12: What is mean by the parameters with respect to Functions? How are Actual and formal parameters different from each other? (3)

SECTION – C

Question 13: Write a program to find all duplicates in a list. (4)
Example:

if a = [1, 2, 3, 2, 1, 5, 6, 5, 5, 5]

[1, 2, 5] have duplicates

Output screenshot:

{1: 2, 2: 2, 3: 1, 5: 4, 6: 1}

Question 14: Find and write the output of the following Python code, stating the reason for the output. (4)

(i)

x = "abcdef"
i = "a"

while i in x:
    print(i, end = " ")

(ii)

x = 4.5
y = 2
print x//y

(iii)

name = "ComputerSciencewithPython"
print(name[3:10])

(iv)

D1 = {"cat": 12, "dog": 6, "elephant ": 23, "bear": 20}
Print("dog" in D1)

Check Also

Class XI & XII Computer Science: Python

11 Class Computer Science Final Exam 2025-26: St. Margaret School, Rohini, New Delhi

  11th Class CBSE Final Examination 2025–26 St. Margaret Sr. Sec. School, Prashant Vihar, Sector …

Leave a Reply