if statement
if...elif...else statement
Trick Question
for loop
for i in iterator:
# statements
- Iterating over a sequence is called a traversal
- Iterable objects are lists, tuples etc.
#Print all numbers from 0 to n.
n = int(input())
for i in range(n + 1):
print(i)
range() function
range(start, stop, step)
#default values
#start = 0
#step = 1
- all values can be positive or negative
- step cannot be zero, and is 1 by default
- generates from <start> value to <stop -1> value
- returns object of class <range>
- when stop > start and step > 0 returns null
- Example
while loop
- used when you don't know how many times you need to iterate

syntax :