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