AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Brief Overview of Python

Standard difficulty · 20 questions · 40 marks · Time: 38 minutes

Name: Date: Score: ____ / 40

Show your working for Sections B and C. Answers are on the last page — try every question first!

Section A — Choose the correct answer8 × 1 = 8 marks
1.
In interactive mode, Python:
  1. cannot show any output
  2. runs only whole programs
  3. saves every line to a file first
  4. runs each statement as soon as it is typed at the >>> prompt
2.
What does this print?
print((24 + 8) % 6 + 5)
  1. 6
  2. 8
  3. 7
  4. 31
3.
What does this print?
print((21 + 2) / 2)
  1. 11.5
  2. 12.5
  3. 11.0
  4. 22.0
4.
What does this print?
print(type(10 / 5))
  1. <class 'int'>
  2. <class 'bool'>
  3. <class 'float'>
  4. <class 'list'>
5.
Which of these is a valid identifier in Python?
  1. roll_no
  2. pass
  3. break
  4. return
6.
What does this print?
m = 74
if m >= 85:
    print('A')
elif m >= 75:
    print('B')
elif m >= 60:
    print('C')
elif m >= 33:
    print('D')
else:
    print('E')
  1. C
  2. E
  3. B
  4. D
7.
How many times is “Hi” printed?
for i in range(8, 31, 2):
    print('Hi')
  1. 23
  2. 11
  3. 12
  4. 13
8.
Which error does this code give?
score = 87
print('Value: ' + score)
  1. IndentationError
  2. IndexError
  3. TypeError
  4. SyntaxError
Section B — Short answer8 × 2 = 16 marks
9.
Distinguish between interactive mode and script mode.
10.
What are x and y at the end?
x = 9
y = 5
x = x // 5
x = x // 5
x = x // 4
11.
What does this print?
print(36, end='@')
print(26)
12.
What do these give? (a) int(27.9) (b) float(29) (c) int('14') + 5
13.
What are (a) c (b) n after this loop?
n = 108
c = 0
while n >= 6:
    n = n - 6
    c = c + 1
14.
How many * are printed in all?
for i in range(1, 9):
    for j in range(i):
        print('*', end='')
    print()
15.
What does this print?
total = 0
for i in range(1, 45):
    if i % 9 == 0:
        total = total + i
print(total)
16.
What does this print?
x = 21
x += 9
x *= 3
x //= 3
x %= 5
print(x)
Section C — Word problems4 × 4 = 16 marks
17.
Explain the arithmetic operators of Python with an example of each, and state their precedence.
18.
This program finds the sale price of an item. What does it print? Give (a) the first line (b) the second.
cost = 2580
discount = 25
off = cost * discount / 100
sale = cost - off
print(off)
print(sale)
19.
What does this program print when m is (a) 65 (b) 83 (c) 37?
m = int(input())
if m >= 90:
    print('A')
elif m >= 75:
    print('B')
elif m >= 55:
    print('C')
elif m >= 40:
    print('D')
else:
    print('E')
20.
This program prints the first multiples of a number. Give (a) the first line printed (b) the second line.
n = 19
total = 0
for i in range(1, 7):
    print(n * i, end=' ')
    total = total + n * i
print()
print(total)
AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Answer key

Brief Overview of Python · AW-11IP-PYO-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) runs each statement as soon as it is typed at the >>> prompt—
2(c) 7** first (right to left), then * / // %, then + and −, left to right
3(a) 11.5/ always gives a float; Python prints a whole float with .0
4(c) <class 'float'>—
5(a) roll_noan identifier starts with a letter or _, has only letters, digits and _, and is not a keyword
6(a) Cthe first true condition, from the top, decides
7(c) 12i takes 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30
8(c) TypeErrora str cannot be joined to an int with +
9Interactive mode runs one statement at a time at the >>> prompt; script mode runs a whole program saved in a .py file.—
10x = 0, y = 5run each line in turn
1136@26end='@' replaces the new line
12(a) 27; (b) 29.0; (c) 19int() drops the fraction part; float() adds .0; int() turns the text into a number
13(a) 18; (b) 0the loop subtracts 6 18 times: 108 = 6 × 18 + 0
14361 + 2 + … + 8
1590multiples of 9 up to 44: 9 + 18 + 27 + 36
16030, 90, 30, 30 % 5 = 0
17+ (7 + 2 = 9), − (7 − 2 = 5), * (7 * 2 = 14), / (7 / 2 = 3.5), // (7 // 2 = 3), % (7 % 2 = 1), ** (7 ** 2 = 49). ** is evaluated first (right to left), then *, /, //, %, then + and −, left to right; brackets change the order.—
18(a) 645.0; (b) 1935.025% of 2580; 2580 − 645.0
19(a) C; (b) B; (c) Ecut-offs 90, 75, 55, 40
20(a) 19 38 57 76 95 114; (b) 39919 × 1 to 19 × 6, then their sum