+ 2
CAN SOMEONE FIX DIS
https://code.sololearn.com/cFVJ73KR55E1/?ref=app My cod3 is flawless but code coach run an error
21 Respuestas
+ 4
Enter a number in your input string that is more than a single digit and you'll see why it won't pass all cases.
+ 2
Indentation Error.
for.....
if.....
str.replace(.....)
+ 2
I suggest you to split the input and check for each sub-string and also add 10 in dictionary.
Refer to this
https://code.sololearn.com/c4zXU1TAc3dT/?ref=app
+ 1
Ok
+ 1
I fixed it but there is still a errror
+ 1
It says line eight
+ 1
On code coach
+ 1
Oh M Tamim
+ 1
Let me try
+ 1
Thanm you it worked
+ 1
Your code will work only for sequences like (0, 1, 2, ....).
Your mistake in this line:
for i in range(len(string))
i takes values (0, 1, 2, ...)
So you need to change your code. For example, like this
https://code.sololearn.com/cXnIj4WvWh8P/?ref=app
+ 1
The problem is the for block. Use the dictionary keys instead of the string.
for i in NUMWORDS.keys() Will fix it
+ 1
In one test case there is 10 in the input string.
So for example - "i have 10 pens"
It outputs - "i have onezero pens".
So fix it.
+ 1
Someone requested for values like 50. For eleven to nineteen you have to include it in the dictionary. I just fixed from one to ten and from 20-999.
https://code.sololearn.com/cbwM0krGVCws/?ref=app
+ 1
Because int has no length and wanted to prevent errors of using numbers from zero to nine as key
0
whats aim of question??
0
what type of error are u getting
0
And how about 11, 12, ..., 101, ..., etc.?
0
https://code.sololearn.com/cbwM0krGVCws/?ref=app
Wanted to simplify but halfway up-to hundreds.
0
Read the code coach question carefully it says the input string contain numbers 0 to 10.
"Take a phrase and replace any instances of an integer from 0-10 and replace it with the English word that corresponds to that integer.
"