Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 674 Bytes

Loops.rst

File metadata and controls

29 lines (17 loc) · 674 Bytes

Loops

The first loop l we will tackle is the while loop.while loops are very useful in python.They are simple to understand but can be very confusing to work with.We are going to under while using the examples give below.Feel to ask if you have any questions you trainer is there to help you out.

condition = 1

while condition < 10:
    print(condition)
    condition += 1


condition = '2'

while condition > 5:
    print 'test'

# Another favorite of many people... the infinite loop #

while True:
    print('doing stuff!!')

# control+c to break script!