0
Why output is 33?
a=6; b=10; c=22 a=b!=c print(a+b+c)
4 Antworten
+ 2
b!=c returns True
so a=1
a+b+c=1+10+22
+ 2
Sorry didn't noticed your reply ,a=True only
But when adding it evaluates to 1
So 1+10+22
+ 1
How is that 'a=1'?
Never mind my qs, I'm beginner.
0
Top Eleven That's because b!=c returns True. Now, in python the Truthy value is equivalent to 1 and Falsy value is equivalent to 0.
So, b!=c returns True which is equivalent to 1. So variable <a> gets value (1) assigned