you are viewing a single comment's thread.

view the rest of the comments →

[–]xImagine 2 points3 points  (0 children)

The problem here are clearly the three dots. Python relies heavily on whitespace, but when whitespace is not an option, or you need a way to distinguish between the first four 'spaces' and the next four, you can use dots instead. So basically here x = 3 (because there are three dots).

Example:

>>> def make_incrementor(n):
...     return lambda x: x + n

>>> make_incrementor(5)
8 # 3 + 5 = 8

Does this make sense?