What minimum and maximum values will be generated for the following Python statement?
What minimum and maximum values will be generated for the following Python statement?
print (random.randrange (100)+1)
Show answerHide answer
Correct answer: (A) 1 and 100
Explanation
random.randrange(100) returns an integer from 0 to 99 (the stop value is excluded). Adding 1 gives a range of 1 to 100.