SolveIt is under development
SolveItNCERT · CBSE · NEET
Question 12 / 13 · latest first
✓ Board-verified
Computer Science · 2026 · 2 marks

CBSE 2026 · Central · Set 4 · Q25

What possible output(s) from the given options will NOT be displayed when the following code is executed? Also, mention, for how many iterations the…

What possible output(s) from the given options will NOT be displayed when the following code is executed ? Also, mention, for how many iterations the for loop in the given code will run?
import random
a = [1,2,3,4,5,6]
for i in range(4):
    j = random.randrange(i,5)
    print(a[j],end='-')
print()
Options :
(A)
$\displaystyle 3$-$\displaystyle 4$-$\displaystyle 5$-$\displaystyle 4$-
(B)
$\displaystyle 2$-$\displaystyle 2$-$\displaystyle 4$-$\displaystyle 5$-
(C)
$\displaystyle 4$-$\displaystyle 3$-$\displaystyle 3$-$\displaystyle 5$-
(D)
$\displaystyle 5$-$\displaystyle 1$-$\displaystyle 2$-$\displaystyle 4$-
ShareWhatsAppTelegram

More from Revision of Python

CBSE Class 12 Computer Science past-paper question from the 2026 board exam, with the answer as CBSE’s own marking scheme gives it. Where our answers come from.