0
Would you please explain function of continue keyword in a little more detail ???
2 Antworten
+ 1
When you want to bypass and not to execute the body of the loop for the iteration that passes through some condition you use the continue keyword, and so the loop continues from the next iteration.
example:
for x in range(10):
if x % 2 == 0:
continue
print x
now the above code would only print odd numbers because if x is even the continue keyword executes and steps the rest of the body of the loop and performs the next iteration.
+ 1
there are some keywords like continue, goto and break.
these are also known as move keywords because they transfer curser to somewhere else according to our condition given.