0
Is there a break or return operation in python?
Like the break and return operations but in normal text Not in loops or functions
4 Respostas
+ 4
Try using exit() to exit your code. sys.exit() may be needed instead (or something similar).
+ 4
How would you expect those operations to work? If break is not in a loop, what is it breaking out from? If return is not in a function, what is it returning from?
+ 2
Russ Jan Markus
I mean an operation to exit a code for example :
a = int(input())
if a == 12:
"exit code"
"some other code"
+ 2
RKK i tryed break, it doesn't work