0
About break statement
I'm currently making a program, but the break statement doesn't work, I want to make my python program end if user inputs "quit", here is the code : if user_input == "quit": break When trying to run it, it says break is outside loop. Help :c
2 ответов
+ 2
use quit()
or
import sys
sys.exit()
break is used for stopping a loop. It does not stop the program itself.
+ 1
Wow thanks for fast answer, it worked :D