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 odpowiedzi
+ 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