This is basic again and I've searched throughout the website but I can't find anything that is specifically about this.
The problem is to write a function that takes an integer and returns a certain number of multiples for that integer. Then, return a list containing those multiples. For example, if you were to input 2 as your number parameter and 4 as your multiples parameter, your function should return a list containing 2, 4, 6, and 8.
What I have so far:
def multipleList(number, multiples):
mult = range(number, multiples, number)
print mult
A test case would be:
print multipleList(2, 9):
>>> [2, 4, 6, 8, 10, 12, 14, 16, 18]
My answer I get:
>>> [2, 4, 6, 8]
None
I know that range has the format (start, stop, step). But how do you tell it to stop after a certain number of times instead of at a certain number?