L4 Conditional Loops
L4 Conditional Loops
and Practise a p
gan
th u
M u
a n
th
L4 - Conditional statements
m a and
n a Loops
Ra
• <
h y
at
• > an
a p
u g
uth
• <= th a n M
n a
m a
• >= R a
• ==
• !=
• a<b<c
h y
at
• a == b == c an
a p
u g
uth
• a != b != a (Will this condition return
th a nTrue or False?)
M
n a
a
m
• Any non-zero number is a
treated
R as True (0 as False) - Same as C
…….. statement
………….
…….. statement
………….
• for iterates over the iterable (string/ list etc..), where as while does not
h y
at
• while uses a condition where as for doesgnot
an
a p
h u
Mut
an
at h
a n
m
Ra
Demo using
at h
a p
gan
th u
u
L4_loops_example.py
n M
th a
n a
m a
R a
L4_loops_example.py
n M
th a
n a
m a
R a
else:
expr2