def fizzBuzz(n):
for i in range(1,n+1):
if i%3==0 and i%5==0:
print("Fizzbuzz")
elif i%3==0 and i%5!=0:
print("Fizz")
elif i%5==0 and i%3!=0:
print("Buzz")
else:
print(i)
if __name__ == '__main__':
n = input('Enter any number:').strip()
fizzBuzz(n)
What is the problem here. Im getting an error that n receives an integer type but string is given?
Answers
Answered by
1
check this question again
Similar questions