Python – While false loop

Python – While false loop

If you want while false functionality, you need not. Try while not fn: instead.

The condition is the loop is actually a pre- condition (as opposed to post-condition do-while loop in, say, C). It tests the condition for each iteration including the first one.

On first iteration the condition is false, thus the loop is ended immediately.

Python – While false loop

In python conditional statements :

is same as False is same as 0 is same as []

Leave a Reply

Your email address will not be published. Required fields are marked *