I'd like to understand something in Python - IF condition. Using this example code:
num = 1
if (num == 1):
print ("op 1")
elif (num < 2):
print ("op 2")
elif (num <= 1):
print ("op 3")
elif (num != 1):
print ("op 4")
else:
print ("Fail")
print ("End")
I'll get the first condition and then go to the end.
How can I do it to check, for example, the first and if True go check the next condition too? And check all of them?
Trying to use CONTINUE not worked; I used a bunch of IFs instead of IF->Elif, but is this the right way to do?
Aucun commentaire:
Enregistrer un commentaire