+ 2

CAN SOMEONE FIX DIS

https://code.sololearn.com/cFVJ73KR55E1/?ref=app My cod3 is flawless but code coach run an error

11th May 2020, 5:56 AM
ACID
ACID - avatar
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.
11th May 2020, 6:12 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Indentation Error. for..... if..... str.replace(.....)
11th May 2020, 6:05 AM
M Tamim
M Tamim - avatar
+ 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
12th May 2020, 11:27 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
+ 1
Ok
11th May 2020, 6:01 AM
ACID
ACID - avatar
+ 1
I fixed it but there is still a errror
11th May 2020, 6:02 AM
ACID
ACID - avatar
+ 1
It says line eight
11th May 2020, 6:05 AM
ACID
ACID - avatar
+ 1
On code coach
11th May 2020, 6:05 AM
ACID
ACID - avatar
+ 1
11th May 2020, 6:05 AM
ACID
ACID - avatar
+ 1
Let me try
11th May 2020, 6:05 AM
ACID
ACID - avatar
+ 1
Thanm you it worked
11th May 2020, 6:06 AM
ACID
ACID - avatar
+ 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
11th May 2020, 7:22 AM
Chelovek Chelovekov
+ 1
The problem is the for block. Use the dictionary keys instead of the string. for i in NUMWORDS.keys() Will fix it
11th May 2020, 8:00 AM
Diab Amos
Diab Amos - avatar
+ 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.
12th May 2020, 7:16 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar
+ 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
12th May 2020, 5:16 PM
Diab Amos
Diab Amos - avatar
+ 1
Because int has no length and wanted to prevent errors of using numbers from zero to nine as key
12th May 2020, 6:19 PM
Diab Amos
Diab Amos - avatar
0
whats aim of question??
11th May 2020, 6:01 AM
KUNDURU THARUN KUMAR REDDY
KUNDURU THARUN KUMAR REDDY - avatar
0
what type of error are u getting
11th May 2020, 6:04 AM
KUNDURU THARUN KUMAR REDDY
KUNDURU THARUN KUMAR REDDY - avatar
0
And how about 11, 12, ..., 101, ..., etc.?
12th May 2020, 1:08 PM
Chelovek Chelovekov
0
https://code.sololearn.com/cbwM0krGVCws/?ref=app Wanted to simplify but halfway up-to hundreds.
12th May 2020, 1:25 PM
Diab Amos
Diab Amos - avatar
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. "
12th May 2020, 1:26 PM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar