Break statement and Program ender

10 2 1
                                        


*TOO TIRED AFTER ALL THAT PREPARATION OF TIHAR*


BY THE WAY:- HAPPY TIHAR TO YOU ALL


BREAK STATEMENT

This is the statement that will literally break you out of loop.

lets say you are running a loop. 

for loop to be exact, 

until certain number meet it won't stop.

for i in range(5): if i == 3: break print(i)


the print will be 

0,1,2

remember in python or in every programming language 

the count starts with 0 not 1.



NOW


PROGRAM ENDER


quit


and 

exit

I believe they are both the same.

they both legit stops the program.

print("This will run")

quit()

print("this won't run")

OH RIGHT:- HAPPY HALLOWEEN



PYTHON JOURNEY BY BEGINNERWhere stories live. Discover now