What is the keyword break for? What is the keyword continue for? Will the following program terminate? If so, give the output.
(a)
balance = 1000
while True:
if balance < 9:
break
balance = balance - 9
print("Balance is", balance)
(b)
balance = 1000
while True:
if balance < 9:
continue
balance = balance - 9
print("Balance is", balance)
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.