Python While Loop

Watch out! This tutorial is over 6 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

With the while loop we can execute a set of statements as long as a condition is true.

#!/usr/bin/python3

# Simple while loop
a = 0
while a < 15:
    print(a, end=' ')
    if a == 10:
        print("made it to ten!!")
    a = a + 1
print()