I have an assignment to make a program that can generate multiples of "x" from 0 to "y".
So i made a code that can do the task and i ran just fine.
for i in range(0, 20):
if i % 2 == 0:
print(i)
But, when i put it in on a function it only returns zero.
def multiplies(x, n):
for i in range(0, n):
if i % x == 0:
return i
print(multiplies(2, 20))
could anyone explain to me what happened? i'm new to programming