This file contains 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 math | |
# replace 999999999 with upper limit of your choice | |
for i in range(1, 999999999): | |
i_as_string = str(i) | |
i_as_list = [] | |
j = 1 | |
output = 0 | |
for digits in i_as_string: | |
output += pow(int(digits),j) |
This file contains 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
def fib(n): | |
if n == 0: | |
return 0 | |
elif n == 1: | |
return 1 | |
else: | |
return fib(n-1) + fib(n-2) | |
print(fib(10)) |