+ 1

Trouble with "Fizz Buzz"- the last number

When I attempt the fizz Buzz, I'm able to get a correct output, except the last line, which is always "range(,1,n,2)", which is my final line of code, instead of the number. How do I fix this?

28th Dec 2021, 7:23 PM
ariPT
4 odpowiedzi
+ 6
aryeh friedman , please share your code here to get helpful answers from the community. thanks!
28th Dec 2021, 7:35 PM
Lothar
Lothar - avatar
+ 3
aryeh friedman delete the last two lines
28th Dec 2021, 7:51 PM
Abhay
Abhay - avatar
+ 2
Thank you!
28th Dec 2021, 7:57 PM
ariPT
+ 1
n = int(input()) for x in range(1, n, 2): if x % 3 == 0 and x % 5 == 0: print("SoloLearn") elif x % 3 == 0: print("Solo") elif x % 5 == 0: print("Learn") else: print(x) print(n) print (range(1, n))
28th Dec 2021, 7:41 PM
ariPT