我需要转换one成1,two转入2等等.
one
1
two
2
有没有办法用库或类或任何东西来做到这一点?
python string text integer numbers
代码高尔夫系列似乎相当受欢迎.我遇到了一些将数字转换为单词表示的代码.一些例子是(编程乐趣的2的权力):
我的同事出现的算法差不多有两百行.似乎会有更简洁的方法来做到这一点.
现行指南:
language-agnostic nlp code-golf rosetta-stone
code-golf ×1
integer ×1
language-agnostic ×1
nlp ×1
numbers ×1
python ×1
rosetta-stone ×1
string ×1
text ×1