What will be the output of the following Python code? [code]random.randrange(1,100,10)[/code]

Đạt Michio

New member
What will be the output of the following Python code?
Code:
random.randrange(1,100,10)
A. 32
B. 67
C. 91
D. 80
 
Answer: c
Explanation: The output of this function can be any value which is a multiple of 10, plus 1. Hence a value like 11, 21, 31, 41…91 can be the output. Also, the value should necessarily be between 1 and 100. The only option which satisfies this criteria is 91.
 

Tìm kiếm

Back
Top