samedi 6 juillet 2019

i've generated random numbers. Now i want to add all the numbers that are generated

i've generated random numbers. Now i want to add all the numbers that are generated.

import random
x= 0
while x<10:
    number = random.randrange(1,10)
    print(number)
    x=x+1

I expect the output

3 9 6 6 4 5 4 7 3 1

Sum: 48




Aucun commentaire:

Enregistrer un commentaire