How can I avoid printing the even numbers in a python code,I'm in project 3,fizzy bus and I'm stuck
17 Answers
New Answer11/30/2020 1:48:59 AM
SANNI ABDUL-AMEEN OLUWADARASIMI17 Answers
New AnswerSANNI ABDUL-AMEEN OLUWADARASIMI you are cheking for parity in a seperate loop, how do you expect it wo work ? Here is the fix👇 https://code.sololearn.com/c2nKcLNIkZ27/?ref=app
Try setting your range to skip the even numbers, then iterate. 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)
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message