The question is to write a function called randNumMaxFor(n, maxValue), with a for loop that generates a list of n random numbers between 0 and maxValue. I can get the random list generated with a for loop but I have no clue how to get to the next step. Thanks for any hints or tips.
import random
def randomNumbers(n):
#create an empty list
myList=[]
#While loop to create new numbers
for n in range(0,9):
#create a random integer between 0 and 9, inclusive
randomNumber=int(random.random()*10)
#add the random number to the list of random numbers using the append() method
myList.append(randomNumber)
return myList
nyou pass in as a parameter? It's re-used in theforloop.