Created
January 17, 2022 08:03
-
-
Save esenthil2018/4374beb2f810195244110f90e1c09046 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import lru_cache | |
| @lru_cache() | |
| def factor(n): | |
| print('Factor{0}!'.format(n)) | |
| return 1 if n < 2 else n * factor(n-1) | |
| factor(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment