CBSE Class 11 Computer Science Question 146 of 173

Data Handling — Question 35

Back to all questions
35
Question

Question 22

Consider the code given below:

import random
r = random.randint(10, 100) - 10
print(r, end = ' ')
r = random.randint(10, 100) - 10
print(r, end = ' ')
r = random.randint(10, 100) - 10
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) 12 45 22
(b) 100 80 84
(c) 101 12 43
(d) 100 12 10

Answer

The possible outcomes of the above code can be:

Option (a) — 12 45 22

Maximum number can be 90 and minimum number can be 0.

Answer