+ 1

Question about lazy evaluation in python

When using an ā€˜or’ statement or an ā€˜and’ statement to compare 2 non-boolean values, why does ā€˜or’ return the first value and why does ā€˜and’ return the second? For example: 3 or 7 returns 3, 3 and 7 returns 7.

9th Aug 2019, 10:42 PM
Nathan
1 Antwoord