+ 5
Code couch
There is changing about No number found in code couch the code running seccsed by 90% whats is missing Challenge Link:https://www.sololearn.com/coach/64?ref=app My code:- word=input() word=word.replace("0","zero") word=word.replace("1","one") word=word.replace("2","two") word=word.replace("3","three") word=word.replace("4","four") word=word.replace("5","five") word=word.replace("6","six") word=word.replace("7","seven") word=word.replace("8","eight") word=word.replace("9","nine") print(word) JaScript Rain Keith
13 odpowiedzi
+ 4
As Rain above mentioned.
+ 3
Rain i was added this statment but still not fully success
Word=wors.replace("10","ten")
+ 3
Mohammed Hassan
word not wors.
and where you add it matters a lot.
+ 3
I used a dictionary to map key:value pairs to solve this Code Coach.
Hope that helps 👍
+ 3
speaking of number to words, here is a convenient module:
num2words
https://sololearn.com/compiler-playground/c9FkN41Q8fba/?ref=app
unfortunately, the code coach test times out if you attempt to install the module.
+ 2
Mohammed Hassan ,
Thanks for including the link to the Code Coach. It makes it much easier to read the description. The description says replace 0 to 10. You replaced 0 to 9.
10 is trickier, because 10 has two digits, and you don't want to replace it with "onezero". There's an easy way though. Good luck.
+ 2
first do ten
+ 2
Mohammed Hassan ,
Yeah, that's the trick. "Hang ten" at the front of your surfboard. Heh. 👍
+ 1
Bob_Li yes
+ 1
Rain
Yea but why should habg at front
+ 1
Mohammed Hassan ,
Oh. I thought you figured it out already, since you said it passed. You hang 10 at the front (replace 10 first) so you can later replace 0 and replace 1 without turning 10 into "onezero".