Pls help with fizzbuzz challenge | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Pls help with fizzbuzz challenge

Too hard i have the code ok 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") else: print(x) #But doesn't work so i tried print(1) print("Solo") print("Learn") print(7) print("Solo") print(11) print(13) Didn'twork also can't hack the hacker

19th May 2021, 6:51 PM
Vlad MDMA
Vlad MDMA - avatar
4 Antworten
+ 1
Vlad MDMA Skip those numbers which are multiple of 2 so do this for x in range(1, n, 2):
19th May 2021, 7:46 PM
A͢J
A͢J - avatar
+ 1
Hey there! Create a if statement that checks if a number is divisible by 2 and then add continue under it. Hope it helps Ôťî
19th May 2021, 6:56 PM
Isaac Fernandes
Isaac Fernandes - avatar
+ 1
Vlad, Please tag Python as the relevant language rather than 'pls help' ÔśŁ Because your code is in Python.
19th May 2021, 8:21 PM
Ipang
0
It keeps failing
19th May 2021, 7:17 PM
Vlad MDMA
Vlad MDMA - avatar