This might be extremely simple but would love some clear explanation. I want to clarify that I know how to apply the formula as it is fairly straightforward, but I am trying to understand the reasoning behind. Here’s the code:
even_or_odd = lambda num: "odd" if num%2 else "even" print even_or_odd(5) print even_or_odd(10)
And here’s the question:
So when num=5 and num%2 results in 1, does the program consider 1 as True and therefore 0 as False?