Created
October 17, 2022 01:17
-
-
Save galenseilis/02e562eba971d3e07a859911bcb7f7b9 to your computer and use it in GitHub Desktop.
Recursively multiply digits of a number's digits of....
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
| import numpy as np | |
| def mult_pers(n): | |
| if len(str(n)) == 1: | |
| return n | |
| else: | |
| prod = np.prod([int(i) for i in str(n)]) | |
| return mult_pers(prod) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment