+ 1

Please i need help in my fizz buzz module project

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") if x % 3 == 0: continue else: print (x)

9th May 2021, 2:05 PM
Victor Okereafor
Victor Okereafor - avatar
2 Réponses
+ 2
I think I already know how to solve it I will use: for x in range (1,n,2): to skip odd numbers
9th May 2021, 2:11 PM
Victor Okereafor
Victor Okereafor - avatar
+ 1
Victor Okereafor You have to skip those numbers which are multiple of 2. So your program will look like this: n = int(input()) for x in range(1, n): if x % 2 == 0: continue 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)
9th May 2021, 2:07 PM
A͢J
A͢J - avatar