S
sl33k
I am printing the numbers from 1 to 100. In that, I want to display
multiples of 3,5 and of both as mulof3, mul0f5 and mulof3and5
respectively.
I am getting the output I want but I would like to format the output
to print only 10 number per line. How do I go about doing this?
for i in range(1, 101):
if i % 3 == 0:
if i % 5 == 0:
print 'mulof3and5',
else:
print 'mulof3',
elif i % 5 == 0:
print 'mulof5',
else:
print i
multiples of 3,5 and of both as mulof3, mul0f5 and mulof3and5
respectively.
I am getting the output I want but I would like to format the output
to print only 10 number per line. How do I go about doing this?
for i in range(1, 101):
if i % 3 == 0:
if i % 5 == 0:
print 'mulof3and5',
else:
print 'mulof3',
elif i % 5 == 0:
print 'mulof5',
else:
print i