walgreen hardcode 了?# Money - 海外理财
c*z
1 楼
10. If you know Python, please answer the following:
There's a problem with the
following Python 2.x code, please fix it.
print reduce(lambda x, y: x+y, filter(lambda x: x%2, map(lambda x: x*x,
xrange
(10**6)))) = sum(x*x for x in xrange(1, 10**6, 2))
After the fix, what would be printed? Explain the result.
There's a problem with the
following Python 2.x code, please fix it.
print reduce(lambda x, y: x+y, filter(lambda x: x%2, map(lambda x: x*x,
xrange
(10**6)))) = sum(x*x for x in xrange(1, 10**6, 2))
After the fix, what would be printed? Explain the result.