diff options
| author | Abigail <abigail@abigail.be> | 2021-01-12 16:01:56 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-01-12 16:01:56 +0100 |
| commit | 4ab51c5acccc0d9e7c75484dc272ee61d508648b (patch) | |
| tree | 376c00a85d40a1c745e7746bd33a138555c549a1 | |
| parent | b24494336813d32e997c11c01b7f6a65e7156c76 (diff) | |
| download | perlweeklychallenge-club-4ab51c5acccc0d9e7c75484dc272ee61d508648b.tar.gz perlweeklychallenge-club-4ab51c5acccc0d9e7c75484dc272ee61d508648b.tar.bz2 perlweeklychallenge-club-4ab51c5acccc0d9e7c75484dc272ee61d508648b.zip | |
Python solution for week 95/part 1
| -rw-r--r-- | challenge-095/abigail/README.md | 1 | ||||
| -rw-r--r-- | challenge-095/abigail/python/ch-1.py | 9 | ||||
| -rw-r--r-- | challenge-095/abigail/t/ctest.ini | 6 |
3 files changed, 16 insertions, 0 deletions
diff --git a/challenge-095/abigail/README.md b/challenge-095/abigail/README.md index 24ed0ef1dc..187bc76711 100644 --- a/challenge-095/abigail/README.md +++ b/challenge-095/abigail/README.md @@ -24,6 +24,7 @@ Output: 0 * [C](c/ch-1.c) * [Node](node/ch-1.js) * [Perl](perl/ch-1.pl) +* [Python](python/ch-1.py) ## [Task 2](https://perlweeklychallenge.org/blog/perl-weekly-challenge-095/#TASK2) diff --git a/challenge-095/abigail/python/ch-1.py b/challenge-095/abigail/python/ch-1.py new file mode 100644 index 0000000000..5378ca65f6 --- /dev/null +++ b/challenge-095/abigail/python/ch-1.py @@ -0,0 +1,9 @@ +import fileinput +import re + +for line in fileinput . input (): + line = line . rstrip () + if (re . match (r'^\d+(\.\d+)?$', line) and line == line [::-1]): + print 1 + else: + print 0 diff --git a/challenge-095/abigail/t/ctest.ini b/challenge-095/abigail/t/ctest.ini index 250efe85a4..2d7d3c30af 100644 --- a/challenge-095/abigail/t/ctest.ini +++ b/challenge-095/abigail/t/ctest.ini @@ -21,3 +21,9 @@ skip = No Unicode support [1-5/awk]
skip = No Unicode support
+
+[1-4/python]
+skip = No Unicode support
+
+[1-5/python]
+skip = No Unicode support
|
