9
votes
Number to text in Python
one dict or three
Using
num_to_words_first_numbers,
ten_by_ten, and
spelled_numbers
was an interesting design choice.
It is certainly fine to leave it as is.
But another approach would pre-populate <...
5
votes
Number to text in Python
Prefer better data over additional logic. As you know, the difficulty of
the problem lies almost entirely in the numbers less than 20. Your
...
4
votes
1
vote
Number to text in Python
dict comprehension with library
Using existing libraries, essentially "standing on the shoulders of giants", allows us to create stronger code. num2words is a library to convert numbers to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
reinventing-the-wheel × 986c++ × 297
python × 215
c × 125
java × 122
python-3.x × 106
beginner × 97
algorithm × 87
performance × 78
strings × 77
c# × 69
linked-list × 69
c++11 × 63
javascript × 51
haskell × 45
object-oriented × 37
sorting × 33
memory-management × 32
c++17 × 32
parsing × 30
pointers × 30
hash-map × 27
cryptography × 25
stack × 25
vectors × 25