0
If statement
What is the difference between: X = 1 if X == 1: print(âfoo!â) if X <= 2: print(âeggsâ) As opposed to X = 1 if X == 1: print(âfoo!â) if X <= 2: print(âeggsâ)
2 RĂ©ponses
+ 1
This case it is no difference cause x=1 but if x<=2 and x! =1 then in first code there isn't output in second code it outputs 'eggs'
+ 1
Put it in code playground and try yourself