0
Please, help! Where is mistake in my code? No numerals
The task is: 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. Input Format: A string of the phrase in its original form (lowercase). Output Format: A string of the updated phrase that has changed the numerals to words. https://code.sololearn.com/cmBkg01Q6URC/?ref=app
4 RĂ©ponses
+ 5
From line 7 remove
.toLowerCase().toUpperCase().toLowerCase()
It's unnecessary since the
The given input format is already in lowercase.
But PâWAN MâURYâ can you explain why the test cases didn't pass when he used
.toLowerCase().toUpperCase().toLowerCase() on line 7?
Ultimately the string is in lowercase, then how does it makes difference in output?
+ 4
You're welcome đ
+ 3
Hi Minho đ°đ·, I don't think so sololearn test cases are dealing with lowercase phrases.
They are dealing with original string phrases and that's why some of the cases are not pass because they are trying to match with original content after replacing numerals. So input format should be orginal that's it and they just try to manipulate us.
+ 1
Thanks a lot! It works now!