mardi 16 février 2016

How do i find the sum of a range of random numbers in python?

import random

def randnums():
    for count in range(6):
        number = random.randint(1,9)
        print(number)

randnums()


From here I am supposed to add the 6 random numbers and display their total... Any help? Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire