break` statement in a `while` loop :# Using the break statement in a while loop
count = 0
while True:
print("Count is", count)
count += 1
if count == 5:
break
print("Done.")Count is 0
Count is 1
Count is 2
Count is 3
Count is 4
Done.while` loop with a `True` condition to repeat a block of code indefinitely. Inside the loop, we print the current value of `count` using the `print()` function and increment the value of `count` by `1` using the `+=` operator.if` statement to check if the value of `count` is equal to `5`. If it is, we use the `break` statement to exit the loop.break` statement is executed, the program continues to execute the `print()` statement outside the loop, which prints the message "Done."break` statement to exit a loop prematurely if a certain condition is met.