I tried to write a code using for loop and if statements but in the output along with the statements the numbers are also repeating.
n=int(input("enter number for n"))
for n in range(1,n):
if n%3==0 and n%5==0:
print("fizzbuzz",n)
else:
if n%5==0:
print("buzz",n)
if n%3==0:
print("fizz",n)
print(n)
Aucun commentaire:
Enregistrer un commentaire