code issue

Chris Angelico rosuav at gmail.com
Thu Apr 21 13:09:25 EDT 2022


On Fri, 22 Apr 2022 at 03:02, Tola Oj <ojomooluwatolami675 at gmail.com> wrote:
>
> for i in range(1, n+1):
>         if i % 3 == 0 and i % 5 == 0:
>             print("Fizzbuzz")
>         elif i % 3 == 0:
>             print("Fizz")
>         elif i % 5 == 0:
>             print("Buzz")
>         else:
>             print(i)
>     print(i, sep='\n')
>
> fizzbuzz(13)

This can't be your complete code, because it won't run like this. Have
a very careful read through of your code, and consider adding some
extra print statements to see what's happening; but if you're asking
for help, you'll definitely need to post the entire program.

ChrisA


More information about the Python-list mailing list