Ques) Difference between break and continue in python

Ans:- Break:A break statement in Python alters the flow of a loop by terminating it once a specified condition is met.
Continue: The continue statement in Python is used to skip the remaining code inside a loop for the current iteration only.

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

Examle of continue:
for i in range(5):
if i == 3:
continue
print(i)

2 Likes

Absolutely correct . Good going . Keep practicing