WHILE LOOP IN PYTHON

Photo of author

By Jackson Taylor

PROGRAM

n=6
while n>0:
    n=n-1
    print 'hai'

OUTPUT

hai
hai
hai
hai
hai
hai

more examples

See also
STRING ADDITION IN PYTHON - CONCATENATION

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works