+3 votes
in Class 12 by kratos

Observe the following program and answer the question that follows:

import random

x = 3 N = random, randint (1, x)

for 1 in range (N):

print 1, ‘#’, 1 + 1

a. What is the minimum and maximum number of times the loop will ***?

b. Find out, which line of output(*) out of (i) to (iv) will not be expected from the program?

(i). 0#1

(ii). 1#2

(iii). 2#3

(iv). 3#4

1 Answer

+1 vote
by kratos
 
Best answer

(a). Minimum Number = 1

Maximum number = 3

(b). Line iv is not expected to be a part of the output.

...