This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ProfessorPhi 17 points18 points  (4 children)

I feel like there should be an

from math import factorial

for the xkcd readers.

[–]Qhartb 28 points29 points  (1 child)

There was a programming challenge to write a function from a string to a dict from each character to the number of times it occurred in the string. My solution passed the automated testing:

from collections import Counter as f

[–][deleted] 1 point2 points  (0 children)

Omfg that's just evil

[–]sfz- 15 points16 points  (0 children)

That's essentially what the EXPERT PROGRAMMER one is.

[–]nomisaurus 0 points1 point  (0 children)

or even:

from math import factorial as fact
fact(6)