Computer Science, asked by advitgoel2811, 1 month ago

Please tell how can we save a random number in dictionary in python?

Answers

Answered by AqdasZishan
2

import random

D = {}

for i in range(0,5):

D[i] = random.randrange(0,10)

print(D)

IT WILL SAVE 5 RANDOM NUMBER BETWEEN 0 AND 10 IN A DICTIONARY AND PRINT THEM.

Similar questions