Which of the following statement will terminate only the current pass of the loop and proceed with the next iteration of the loop? *
Answers
Answered by
4
Answer:
The break statement in Python terminates the current loop and resumes execution at the next statement, just like the traditional break found in C. The most common use for break is when some external condition is triggered requiring a hasty exit from a loop. The break statement can be used in both while and for loops.
Code sample
for letter in 'Python': # First Example
if letter == 'h':
break
print 'Current Letter :', letter
var = 10 # Second Example...
Explanation:
Answered by
1
Answer:
The break statement is used to exit the current loop. The continue statement is used to exit the current iteration of a loop and begin the next iteration.
Explanation:
Similar questions