when do we use "ELSE "statement in python and "ELIF" statement in python ???????????????
Answers
ELSE :-
we use this statement it we have only one if or for or while
ELIF:-
if we have more iterative and conditional statements
example
if a > b :
if a > b : if b > c:
if a > b : if b > c: print (a, b, c)
if a > b : if b > c: print (a, b, c) else:
if a > b : if b > c: print (a, b, c) else: print (a, c, b)
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c :
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c :
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c)
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else:
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else:
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a)
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a)
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a) else:
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a) else: if b > a:
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a) else: if b > a: print (c, b, a)
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a) else: if b > a: print (c, b, a) else:
if a > b : if b > c: print (a, b, c) else: print (a, c, b) elif b > c : if a > c : print (b, a, c) else: print (b, c, a) else: if b > a: print (c, b, a) else: print (c, a, b)