Report Bug

Qus

Which can be the output of the following Python code?

import random
print(random.randrange(1,100,10))
Qus

निम्नलिखित पायथन कोड का आउटपुट कौन सा हो सकता है?

import random
print(random.randrange(1,100,10))



A. 32
B. 67
C. 91
D. 80


Solution
C. 91



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.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad