diff options
Diffstat (limited to 'challenge-329/ysth/python')
| -rw-r--r-- | challenge-329/ysth/python/ch-1.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-329/ysth/python/ch-1.py b/challenge-329/ysth/python/ch-1.py new file mode 100644 index 0000000000..3ec3594967 --- /dev/null +++ b/challenge-329/ysth/python/ch-1.py @@ -0,0 +1,10 @@ +import sys +import re + +inputs = sys.argv[1:] + +for string in inputs: + #new_string = string.translate({ c:' ' for c in range(ord('a'),ord('z')+1) }) + #unique_integers = sorted(set(new_string.split())) + unique_integers = [int(i) for i in sorted(set(re.findall(r'0*(\d+)', string)))] + print(f'{string:<30} -> {str(unique_integers)}') |
