Saved Bookmarks
| 1. |
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 execute? b. Find out, which line of output(s) out of (i) to (iv) will not be expected from the program? (i). 0#1 (ii). 1#2 (iii). 2#3 (iv). 3#4 |
|
Answer» (a). Minimum Number = 1 Maximum number = 3 (b). Line iv is not expected to be a part of the output. |
|