samedi 23 octobre 2021

How to break my code in if or else statement? [closed]

I need help in breaking an if or else statement. In my code, I have a condition let's say it is 'condition1' if it's true it should do something, and if it's false, I do not want to run my code further. This is how my code looks like...

#some conditions
if condition1 == True:
#do something
else:
#do something
#don't go further

#some more code

How do I break my code after the else statement if "condition1" is false? I tried using the 'break' command but it doesn't work.

Aucun commentaire:

Enregistrer un commentaire