I am trying to write code that allows me to find the first few multiple numbers. This is one of my attempts:
def printMultiples(n, m):
for m in (n,m):
print(n, end = ' ')
I realized that, substituting for m in (n, m):it, it will go through a cycle for any number m.
def printMultiples(n, m):
'takes n and m as integers and finds all first m multiples of n'
for m in (n,m):
if n % 2 == 0:
while n < 0:
print(n)
After several searches, I managed to find only sample code in java, so I tried to translate it into python, but I did not get any results. I have a feeling that I should use a function range()somewhere in this, but I have no idea where.
source
share