Post History
Python 3, 399 bytes def f(n): if n<1:return'zero' t=1000;m=t*t;r='r fif six seven eigh nine ';b=f'one two three four five six seven eight nine ten eleven twelve thir fou{r}twen thir fo{r}'....
Answer
#1: Initial revision
# [Python 3], 399 bytes ``` def f(n): if n<1:return'zero' t=1000;m=t*t;r='r fif six seven eigh nine ';b=f'one two three four five six seven eight nine ten eleven twelve thir fou{r}twen thir fo{r}'.split(' ');s=' '.join([f(k:=n//m)+' million'][:k]+[f(k:=(n:=n%m)//t)+' thousand'][:k]+[f(k:=(n:=n%t)//100)+' hundred'][:k]);n%=100;s+=' and '*(s*n>'') if n>19:s+=b[n//10+17]+'ty'+'-'*((n:=n%10)>0) return s+b[n-1]+'teen'*(n>12) ``` [Try it online!][TIO-kuev9d8s] [Python 3]: https://docs.python.org/3 [TIO-kuev9d8s]: https://tio.run/##bZLdbsIwDIWvx1NYSCgNhZEUNka78iKICxjJmlFclJi/TXt25tBxMy0XiX38Haexur9Q1eD4Ze@v142xYBOUeefBWcBXnXtDB4/i0/hGdB6o1EqpYldSnwpfCg@WueDOEMzRIBj3XgE6NCCKdWlFwxGdGqDKGwO2OUTD0fxxUGuhmNY3lU6mZowq56Pry3@zgvecU/EY9rWjRICQRSj5ePxoHCYLm2zzEkejnUwF7FxduwbFcpFvl2lbS5DrvZ0cjSgi/PZDWOHmH4aY4edGqjrgxptfSBbYi3MoQsoXsxdEPwl9nAsh27nN9Szn4nqBsUOqp8tU0EWkYshk21wrOVeMt/OFkDI81JEzBpniHpm8kgn0tgomQAkLNQA9gAnvMXrmMOMze4pCFmX@piiMJzfptu4BG6cqG7eKVjpTGUuz@1p2bOPhDI5nfL8y33uHlNju1zmfz767A/4zzlJefwA "Python 3.8 (pre-release) – Try It Online"