3 ms·
What bugs me about this article is that the solutions he takes for project euler are taken from a website which tries to make Python into a functional language
by johnfn 17y ago
What bugs me about this article is that the solutions he takes for project euler are taken from a website which tries to make Python into a functional language and are needlessly verbose. For instance, the normal way to solve PE#1 is:
print sum([x for x in range(1001) if x%3==0 and x%5==0)]
Quite a bit shorter than the clojure solution.
Further, their "isPalindrome" function involves a "digits_from_num" call, and is almost 10 lines in total. You could shorten that to one if you check pal == pal[::-1].
Essentially, the guy copied code from a website which wasn't really trying to show off how succinct python could be.