On 4/21/22 13:09, Chris Angelico wrote:
On Fri, 22 Apr 2022 at 03:02, Tola Oj <ojomooluwatolami...@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
fizzbuzz is one of Angela Yu's lab assignments in her py course.If you ask her, she'll gladly tell you where you are going wrong and even supply an entirely correct version, if you want it...
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to