Continue Statement:-
Python में continue का use किसी दी गयी condition के according current loop iteration को skip करने के लिए किया जाता है। और skip करने के बाद Loop next iteration से Start हो जाता है। simply हम कह सकते हैं कि Python में continue का use हम वहाँ करते हैं जब हमें किसी condition पर loop execution को skip करना हो।
Example
|
for n in range(1, 8) : if(n == 3) : continue print(n)
Output 1 2 4 5 6 7
|
n = 0 while n < 8 : n = n+1 if(n==3) : continue print(n) Output 1 2 4 5 6 7 7 |
Continue Statement:-
In Python, continue is used to skip the current loop iteration according to a given condition. And after skipping, the loop starts from next iteration. Simply we can say that we use continue in Python when we have to skip loop execution on some condition.
Example
|
for n in range(1, 8) : if(n == 3) : continue print(n)
Output 1 2 4 5 6 7
|
n = 0 while n < 8 : n = n+1 if(n==3) : continue print(n) Output 1 2 4 5 6 7 7 |