Q. Consider the code given below:

 

import random

r = random.randrange (100, 999, 5)

print(r, end = ' ')

r = random.randrange(100, 999, 5)

print(r, end = ' ')

r = random.randrange (100, 999, 5)

print(r)

 

Which of the following are the possible outcomes of the above code? Also, what can be the maximum and minimum number generated by line 2?

 

(a) 655, 705, 220

(b) 380, 382, 505

(c) 100, 500, 999

(d) 345, 650, 110

 

Answer =

 

Possible outcomes of the above code is option (a) & (d).

 

Minimum value:- 100

Maximum value:- 995

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post