Difference between break and continue statement

Break statement stops the entire process of the loop
for i in range(5):
if i ==3:
break
print(i) it will return 0,1,2 then stop the loop

continue statement is used to skip the iteration of the loop and goes to next iteration
for i in range(5):
if i == 3:
continue
print(i) it will return 0,1,2,4 and skip the 3 from the iteration

1 Like

Well explained @souravkrsheel99 :innocent:

1 Like