From f24722d42bcfc185db245be96d9323da78e53c12 Mon Sep 17 00:00:00 2001 From: steven-y-e Date: Tue, 1 Aug 2023 13:50:07 -0400 Subject: [PATCH] feat(solution): problem #25 --- solutions/025/1000digitfibonacci.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 solutions/025/1000digitfibonacci.py diff --git a/solutions/025/1000digitfibonacci.py b/solutions/025/1000digitfibonacci.py new file mode 100644 index 0000000..b5d8762 --- /dev/null +++ b/solutions/025/1000digitfibonacci.py @@ -0,0 +1,14 @@ +previous = 0 +current = 1 +upcoming = 1 +index = 1 + +while(True): + if len(str(current)) >= 1000: + break; + upcoming = previous + current + previous = current + current = upcoming + index += 1 + +print("index", index) \ No newline at end of file