Q&A CBSE12D-2015-B01F #6516
Question:
What are the possible outcome(s) executed from the following code? Also specify the maximum and minimum values that can be assigned to variable NUMBER.
STRING="CBSEONLINE"
NUMBER=random.randint(0,3)
N=9
while STRING[N]!='L':
print STRING[N]+STRING[NUMBER]+'#',
NUMBER=NUMBER + 1
N=Nl
(i) (ii) (iii) (iv)
ES#NE#IO# LE#NO#ON# NS#IE#LO# EC#NB#IS#
Answer:
(i) ES#NE#IO#
(iv) EC#NB#IS#
Minimum value of NUMBER = 0
Maximum value of NUMBER = 3
