Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not only that but in python 3.8, it can be written:

    def factorial(n):
        return math.prod(range(1,n+1))


Nice!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: