2019-02-22 02:59:26 +08:00

18 lines
277 B
Python

def gen_fib():
a, b = 0, 1
while True:
yield b
a, b = b, a + b
def digit_in_fib(n):
for x in gen_fib():
print(x)
s = str(x)
l = len(s)
if l >= n:
return s[n - 1]
n -= l
print(digit_in_fib(800))