samedi 5 septembre 2015

Creating a random number generator using a for-loop in Python

I have a homework question where I have to make a random number generator using a for loop that gives me a random numbers 'n' number of times. this is what i have so far.

import random
def randNum(n):
    myList = []
    randomNumber = int random.random() * 10)
    myList.append(randomNumber)
    for  in range (1,10):
        return myList

Any pointers? I'm very new to coding and would love to know how I can improve/make things simpler. thanks




Aucun commentaire:

Enregistrer un commentaire