diff options
| author | Paulo Custodio <pauloscustodio@gmail.com> | 2024-10-22 18:11:56 +0100 |
|---|---|---|
| committer | Paulo Custodio <pauloscustodio@gmail.com> | 2024-10-22 18:11:56 +0100 |
| commit | 45c413ded143a3d7548e837e2cc459f4fabcda41 (patch) | |
| tree | b82f0097d81f98326854e90cddbfaa9ff9613c15 /challenge-179/paulo-custodio/python/ch-1.py | |
| parent | c3edc9149c2c1d435eecf347139ca83094e1d86e (diff) | |
| download | perlweeklychallenge-club-45c413ded143a3d7548e837e2cc459f4fabcda41.tar.gz perlweeklychallenge-club-45c413ded143a3d7548e837e2cc459f4fabcda41.tar.bz2 perlweeklychallenge-club-45c413ded143a3d7548e837e2cc459f4fabcda41.zip | |
Add Python solutions
Diffstat (limited to 'challenge-179/paulo-custodio/python/ch-1.py')
| -rw-r--r-- | challenge-179/paulo-custodio/python/ch-1.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/challenge-179/paulo-custodio/python/ch-1.py b/challenge-179/paulo-custodio/python/ch-1.py new file mode 100644 index 0000000000..c00ee3dc90 --- /dev/null +++ b/challenge-179/paulo-custodio/python/ch-1.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +# Challenge 179 +# +# Task 1: Ordinal Number Spelling +# Submitted by: Mohammad S Anwar +# +# You are given a positive number, $n. +# +# Write a script to spell the ordinal number. +# +# For example, +# +# 11 => eleventh +# 62 => sixty-second +# 99 => ninety-ninth + +from num2words import num2words +import sys + +print(num2words(int(sys.argv[1]), to='ordinal')) |
