can else be used with while?
While loop with else. Same as with for loops, while loops can also have an optional else block. The else part is executed if the condition in the while loop evaluates to False . The while loop can be terminated with a break statement.