3 ms·
Can you give me an example where the two return different values?
by hatmatrix 5y ago
Can you give me an example where the two return different values?
- klyrs 5y agoWhen condition() is truthy, the first evaluates to True and the second evaluates to [] Try it out. https://ideone.com/GciAs8 https://ideone.com/GciAs8
- hatmatrix 5y agoSo the problem is not in condition() but in the the other statement/expression. Similarly, True and False or 5 returns 5 rather than False.