0

I can't understand the if code

Pls can someone help me cause I found it so hard

3rd Mar 2018, 1:57 PM
Elementalist Lux
Elementalist Lux - avatar
1 Answer
+ 1
'If' statement only execute if some condition are 'true'. Eg. if True: print('hi') is same as if 2<3: print('hi') both will output 'hi'. Now condition is false, Eg, if false: print('hi') (or) if 2>3: print('hi') They will not output 'hi' because condition is false. To be more clear, here's last example. if 2>3: print('hi') else: print('hello') This will ouput 'hello' because condition is false.
3rd Mar 2018, 2:37 PM
Sylar