Write a program to display the first 7 multiples of 7 using both(for, while) loops
print('First 7 multiples of 7')
print('for loop:', end=' ')
for i in range(1,8):
n = 7*i
print(n, end=' ')
print()
print('while loop:', end=' ')
i = 1
while i < 8:
n = i*7
print(n, end=' ')
i += 1
print()
Comments
Leave a comment