Q. What possible outputs(s) are expected to be displayed on screen at the time of execution of the program from the following code ? Also specify the maximum values that can be assigned to each of the variables FROM and TO.
import random
AR = [20,30,40,50,60,70];
FROM = random.randint(1,3)
TO = random.randint (2,4)
for K in range (FROM, TO + 1):
print (AR[K], end = "#")
(i) 10#40#70#
(ii) 30#40#50#
(iii) 50#60#70#
(iv) 40#50#70#
Answer :-
(ii) 30#40#50#
Maximum value FROM, TO is 3,4 respectively.
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )