KnowledgeBoat Logo

Computer Science

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

Python Data Handling

25 Likes

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.

Answered By

11 Likes


Related Questions