I am enjoying the book very much. So a big thank you!
In my opinion some of the solutions are very concise/elegant at the expanse of readability.
For example the solution to 6.1:
def string_to_int(s):
return functools.reduce(lambda running_sum,
c: running_sum * 10 + string.digits.index(c),
s[s[0] == '-':],
0) * (-1 if s[0] == '-' else 1)
Personally I found it somewhat hard to read. For example in day to day job, I would test s[0] == ‘-’ and save it to clearly named variable. Is that a way to demonstrate ability to the interviewer/ save whiteboard space?
Maybe it’s just my inexperience with Python…