Python Control Flow if Statements The if statement is used for conditional execution x = 5 if x < 0 : print ( 'x is Negative' ) elif x == 0 : print ( 'x is Zero' ) elif x > 0 : print ( 'x is Positive' ) else : print ( 'x is not a number' ) The while statement The while statement is used for repeated execution as long as an expression is true x = 0 while x < 6 : print ( x ) x = x + 1 : for Statements In Python’s for statement iterates over the items of any sequence (a list or a string) fruits = ["apple", "orange", "banana", "cherry"] for fruit in fruits : print ( fruit ) The range() Function If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions for i in range ( 5 ): print ( i ) Output 0 1 2 3 4 More example on range range ( 5 , 10 )...