[Tutor] list comprehension with else

Danny Yoo dyoo at hashcollision.org
Sun Jan 18 23:20:55 CET 2015


Just to add, log(0) is mathematically undefined.
https://en.m.wikipedia.org/wiki/Logarithm.

So depending on the problem's context, it might be worth asking why log is
being applied on this input.  Is such input expected?  Make sure the code
isn't trying to correct for input that shouldn't be there in the first
place.


More information about the Tutor mailing list