How to use while not in Python

A while not loop repeatedly executes the body of the loop until the condition for loop termination is met.

Solution for How to use while not in Python : You can use a while not loop Use the syntax while not condition with condition as a boolean expression to execute the loop’s body if condition evaluates to False.

Alternatively, use the syntax while variable not in iterable to execute the loop’s body if variable is not in iterable.

a_list = [1,2,3]


how-to-use-while-not-in-python