1
\$\begingroup\$

Here's a simple one.

In the shortest code possible, given an arbitrary number such as 567421, print it out in words:

five
six
seven
four
two
one

You may assume the input is an integer that is already provided in a one-letter variable such as n.

\$\endgroup\$
3
  • \$\begingroup\$ I see, sorry about that, didn't find those when i was searching. \$\endgroup\$ Commented Jun 27, 2014 at 12:52
  • \$\begingroup\$ Though both possible duplicates ask something slightly different. \$\endgroup\$ Commented Jun 27, 2014 at 12:52
  • \$\begingroup\$ In particular the only change you need to make to answers of the duplicate mentioned by undergroundmonorail is to call the code you already have for each digit of the input. \$\endgroup\$ Commented Jun 27, 2014 at 12:56

1 Answer 1

2
\$\begingroup\$

Python

for i in `n`:print' ottffssennwhoiieiieoruvxvgn  ere ehe  e   nt'[int(i)::9]

"Inspired" by https://codegolf.stackexchange.com/a/32156/18638

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.