きったんの頭

#! /usr/bin/env python3
"""
pe25.py
https://mind.kittttttan.info/py/pe25
"""

def pe25(digits=1000):
    """
    What is the first term in the Fibonacci sequence to contain 1000 digits?
    """
    a, b, n = 1, 0, 1
    while len(str(a)) < digits:
        a,b = a+b, a
        n += 1
    print(n, a)

if __name__ == "__main__":
    pe25()