From e0aab0618bc5ef76fe59a6f2428efcb074577c95 Mon Sep 17 00:00:00 2001 From: Bill Ewanick Date: Fri, 15 Mar 2024 00:02:42 -0400 Subject: [PATCH] Some python stuff??? --- flake.nix | 3 +++ src/python/2.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/python/2.py diff --git a/flake.nix b/flake.nix index 5e59783..62a2514 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,9 @@ gofumpt nodejs + + python310 + black ]); shellHook = '' diff --git a/src/python/2.py b/src/python/2.py new file mode 100644 index 0000000..7c9047f --- /dev/null +++ b/src/python/2.py @@ -0,0 +1,28 @@ +fibs2 = [1, 2, 3, 5, 8, 13] + +i = 1 +j = 2 +b = 0 +n = 4000000 +fibs = [] +fibs.append(i) +fibs.append(j) + +while b < n: + b = i + j + if b < n: + fibs.append(b) + else: + fibs + i = j + j = b + +count = 0 +for fib in fibs: + if (fib % 2) == 0: + count += fib + else: + count += 0 + +print(count) + \ No newline at end of file