Python continue Statement
Please explain the use of continue Statement in Python. Give me an example as well
By : Tharani Email : tharani@tekstart.lk
Date/time : 2017-07-30

ID 1
Name Manori
Email marori@tekstart.lk
Answer continue statement can be used only in both while and for loops.
continue statement rejects all the remaining statements in the current iteration of the loop and moves the control back to the top of the loop.
n=10
while n>0:
     n-=1
     if n%2==0:
           continue
     print(n)
Date/Time 2017-07-30

Name
Email
Answer
User Code