Completed
Class 12 CS – Python Revision(Class 11 ) Challenge
Questions From This Challenge
Q1mcq1 mark
What will be the output? x = 17 y = 5 z = 2 print(x // y + x % y * z ** 2)
11 ✓
15
25
29
Q2mcq1 mark
What will be the output? x = 0 for i in range(1, 5): for j in range(i): if j == 1: continue x = x + i print(x)
18
20
21 ✓
24
Q3mcq1 mark
What will be the output? s = "COMPUTER" x = s[1:7:2] y = s[-1:-6:-2] print(x + y)
OPTRE
OPTRTP ✓
OPUTRE
OPTU
Q4mcq1 mark
What will be the output? L = [3, 6, 9, 12] L[1] = L[-1] // 2 L[-1] = L[0] + L[1] print(L)
[3, 6, 9, 9] ✓
[3, 6, 9, 12]
[3, 9, 9, 12]
[3, 6, 9, 15]
Q5mcq1 mark
What will be the output? t = (10, 20, 30, 40, 50) print(t[1:5:2] + t[:1])
(20, 40, 10) ✓
(10, 20, 40)
(20, 30, 40)
(10, 30, 50)
Q6mcq1 mark
What will be the output? d = {'A': 10, 'B': 20, 'C': 30} d['B'] = d['A'] + d['C'] d['D'] = d['B'] - 15 del d['A'] print(d)
{'B': 40, 'C': 30, 'D': 25} ✓
{'A': 10, 'B': 40, 'C': 30, 'D': 25}
{'B': 30, 'C': 30, 'D': 15}
{'B': 40, 'C': 30, 'D': 15}
Q7mcq1 mark
What will be the output? s = "MISSISSIPPI" x = 0 for ch in s: if ch in "IS": x = x + 1 else: x = x - 1 print(x)
3
5 ✓
8
9
Q8output1 mark
What will be the output?
L = [5, 10, 15, 20] L = L[1:] + L[:1] L[1] = L[1] + L[-1] print(L)
Correct output:
[10, 20, 20, 5]Q9mcq1 mark
What will be the output? d = {'x': 2, 'y': 3, 'z': 4} total = 0 for k in d: total = total + d[k] d['y'] = total print(d['y'], total)
9 9 ✓
10 9
9 10
10 10
Q10mcq1 mark
What will be the output? n = 25 count = 0 while n > 3: if n % 5 == 0: n = n // 5 else: n = n - 4 count = count + 1 print(n, count)
1 2 ✓
2 3
3 4
5 2
Q11mcq1 mark
What will be the output? import math x = math.sqrt(49) + math.ceil(4.2) - math.floor(3.9) print(x)
7.0
8.0
9.0 ✓
10.0
Q12mcq1 mark
What will be the output? import statistics L = [4, 7, 7, 9, 13] print(statistics.mean(L), statistics.median(L), statistics.mode(L))
8.0 7 7 ✓
8.0 8 7
7.0 7 8
8.0 9 7
Q13mcq1 mark
What is the possible range of values produced by the following statement? import random x = random.randint(5, 15)
5 to 14
5 to 15 ✓
6 to 15
0 to 15
Q14output1 mark
What will be the output?
L = [2, 4, 6] x = L L[1] = 10 x.append(12) print(L) print(x)
Correct output:
[2, 10, 6, 12]
[2, 10, 6, 12]Q15mcq1 mark
What will be the output? d = {'A': 10, 'B': 20, 'C': 30} x = 0 for k in d: if d[k] > 15: x = x + d[k] else: x = x - d[k] d['D'] = x print(d)
{'A': 10, 'B': 20, 'C': 30, 'D': 40} ✓
{'A': 10, 'B': 20, 'C': 30, 'D': 60}
{'A': 10, 'B': 20, 'C': 30, 'D': 20}
{'A': 10, 'B': 20, 'C': 30, 'D': -40}