0
I need some help with the No Numerals challenge. Failing 1 test case
I'm not sure what's wrong with the code. The test case it's failing is hidden: https://code.sololearn.com/c82wMVuVBhG9/?ref=app
4 Respostas
0
I give you a hint:
Run your code with the input '10'
+ 1
Create a dictionary mapping numbers 0-10 to its words form.
And the. use string replace method to change the value of index matching to that of dictionary
+ 1
Thank you. I see the problem now.
+ 1
I've now solved it. Thanks for the replies guys
I used a tuple to define the numbers as words. I iterated through it backwards to deal with 10 first.
I think the code is quite elegant now.