diff options
| author | Abigail <abigail@abigail.be> | 2021-07-19 15:48:02 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-07-19 16:17:26 +0200 |
| commit | 1340f41d195abe258ff1664bf0e7b4e5f1dd8990 (patch) | |
| tree | 7fc1345c2fb755ba71103da366fd16301859dfa0 /challenge-122/abigail/python | |
| parent | 4ded51d7ecb942711df0c3dc0c9fca2f3ea1186a (diff) | |
| download | perlweeklychallenge-club-1340f41d195abe258ff1664bf0e7b4e5f1dd8990.tar.gz perlweeklychallenge-club-1340f41d195abe258ff1664bf0e7b4e5f1dd8990.tar.bz2 perlweeklychallenge-club-1340f41d195abe258ff1664bf0e7b4e5f1dd8990.zip | |
Solutions in 17 languages for week 122, part 1.
Diffstat (limited to 'challenge-122/abigail/python')
| -rw-r--r-- | challenge-122/abigail/python/ch-1.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-122/abigail/python/ch-1.py b/challenge-122/abigail/python/ch-1.py new file mode 100644 index 0000000000..b2fdeea20c --- /dev/null +++ b/challenge-122/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 + +s = 0 +c = 0 + +for n in fileinput . input (): + s = s + int (n) + c = c + 1 + print (s // c) |
