From 62167a58d3c55a71f37815381c858fad45825a8d Mon Sep 17 00:00:00 2001 From: Abigail Date: Wed, 17 Nov 2021 16:09:09 +0100 Subject: Solutions for week 139 --- challenge-139/abigail/python/ch-1.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 challenge-139/abigail/python/ch-1.py (limited to 'challenge-139/abigail/python/ch-1.py') diff --git a/challenge-139/abigail/python/ch-1.py b/challenge-139/abigail/python/ch-1.py new file mode 100644 index 0000000000..f2a73b2d4a --- /dev/null +++ b/challenge-139/abigail/python/ch-1.py @@ -0,0 +1,19 @@ +#!/opt/local/bin/python + +# +# See ../README.md +# + +# +# Run as: python ch-1.py < input-file +# + +import fileinput + +for line in fileinput . input (): + list = line . split (" ") + sorted = 1 + for i in range (1, len (list)): + if list [i - 1] > list [i]: + sorted = 0 + print (sorted) -- cgit