Can someone explain to me why when evaluating numerical expressions Python as a result of evaluation returns the last thing that was evaluated?
For example:
3 and 5
evaluates to
5
Another question I have is why is it even evaluating these expressions, when I try to check:
3 == True
I get False but when I evaluate:
3 and 5
and get 5 as a result it obviously( I think) thinks that 3 evaluates to True since it wouldn't continue evaluating if it thought otherwise( I might be wrong here). In contrast when I evaluate:
0 and 3
I get 0, what I think is happening is that Python checks whether 0 is True, decides it's not and spits it out.
I'm sorry if it all sounds a bit chaotic but I stumbled across this in my book and was curious if there is something I'm missing.