Posted by: lihan on: October 2, 2011
Python 2.5 is relatively recent and not supported everywhere yet, so it’s important to understand the behavior of both Python 2.5 and earlier versions. This quiz is cited from here. (a) What number does the following code print? adders = [] for i in range(0, 100): adders.append(lambda x: x+i) print adders[17](42) (b) What about the [...]