From 8487fe3f219c99dc720f99e2d53197c211deaf5b Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 31 Jan 2022 15:50:18 +0100 Subject: Week 150: Solutions --- challenge-150/abigail/python/ch-1.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 challenge-150/abigail/python/ch-1.py (limited to 'challenge-150/abigail/python/ch-1.py') diff --git a/challenge-150/abigail/python/ch-1.py b/challenge-150/abigail/python/ch-1.py new file mode 100644 index 0000000000..7d56fa686d --- /dev/null +++ b/challenge-150/abigail/python/ch-1.py @@ -0,0 +1,17 @@ +#!/usr/local/bin/python3 + +# +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-150 +# + +# +# Run as: python ch-1.py < input-file +# + +import fileinput + +for line in fileinput . input (): + fib_prev, fib_last = line . strip () . split (" ") + while len (fib_last) < 51: + fib_prev, fib_last = fib_last, fib_prev + fib_last + print (fib_last [50:51]) -- cgit