3 ms·
Number 5 should read (not that it matters): print map(lambda x: "Happy Birthday " + ("to you" if x != 2 else "dear Name"),range(4)) In general, I was expecting
by Cogito 14y ago
Number 5 should read (not that it matters):
print map(lambda x: "Happy Birthday " + ("to you" if x != 2 else "dear Name"),range(4))
In general, I was expecting more. I was hoping for some slightly more obscure examples, though I guess the point is that many common problems are 1 liners in Python.