3 ms·
I mainly meant "improve" in terms of conciseness and readability. I didn't see any need for optimization because the snippet runs instantly: $ time python -c
by BrandonM 16y ago
I mainly meant "improve" in terms of conciseness and readability. I didn't see any need for optimization because the snippet runs instantly:
$ time python -c "print sum(x for x in xrange(2, 1000) if sum(int(y) for y in str(x)) == 7)"
9324
real 0m0.138s
user 0m0.012s
sys 0m0.012s