+ 1

FizzBuzz! i have a problem with it

if the num is multiple of 3 fizz and if 5 buzz and ignore the evens

4th Dec 2021, 4:44 AM
Amr Monsef
Amr Monsef - avatar
5 Answers
+ 4
Skipping even numbers has to be the first condition.
4th Dec 2021, 5:31 AM
Simon Sauter
Simon Sauter - avatar
+ 11
there is also an indentation error in line: elif x % 2 == 0:
4th Dec 2021, 7:21 AM
Lothar
Lothar - avatar
+ 4
Show your try. You can't get the answer without showing how far you tried. Share your code here and describe exactly where you are stuck
4th Dec 2021, 5:10 AM
Rishi
Rishi - avatar
+ 2
Rishi n = int(input()) for x in range(1, n): if x % 3 == 0 and x % 5 == 0: print("SoloLearn") elif x % 3 == 0: print("Solo") elif x % 5 == 0: print("Learn") elif x % 2 == 0 : continue else: print(x)
4th Dec 2021, 5:13 AM
Amr Monsef
Amr Monsef - avatar
+ 1
Thanks Lothar i got it right now :)
4th Dec 2021, 11:42 AM
Amr Monsef
Amr Monsef - avatar