0
I can't understand the if code
Pls can someone help me cause I found it so hard
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.