The following question was asked today as part of a friendly coding competition at Europython.
Here's my submission, can anyone do better?
Bonus points were awarded for "the shortest one liner possible". Here at the conference, it is somewhat implied that we'd be using Python, but feel free to use your favorite language.Find the sum of the digits in the number 1000! (! -> factorial)
Here's my submission, can anyone do better?
sum([int(x) for x in iter(str(math.factorial(1000)))])
PS: If you don't know how to write one liners, you can still participate in the exercise; it's good practice!