0

Is this program having any error because the sololearn app showing the error which are hidden:- in the description there is code

You write a phrase and include a lot of number characters (0-9), but you decide that for numbers 10 and under you would rather write the word out instead. Can you go in and edit your phrase to write out the name of each number instead of using the numeral? Task: 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. Sample Input: i need 2 pumpkins and 3 apples Sample Output: i need two pumpkins and three apples https://code.sololearn.com/cW7THujazqfb/?ref=app https://code.sololearn.com/cW7THujazqfb/?ref=app https://code.sololearn.com/cW7THujazqfb/?ref=app

9th Nov 2020, 8:35 AM
sahil kulkarni
sahil kulkarni - avatar
6 Respuestas
+ 3
Yes, much like you are doing right now, you just have to replace "10" by "ten" as well. The others are getting replaced correctly already.
9th Nov 2020, 9:20 AM
Shadow
Shadow - avatar
+ 3
You also need to replace all instances of "10" by "ten", something you don't do right now. It seems you tried to account for something like that, but I don't really understand what "top" is for or why "out" is printed.
9th Nov 2020, 9:06 AM
Shadow
Shadow - avatar
+ 2
Oh, I think you got confused by the term "to write out". This doesn't mean to write "out" instead of the number, but to write the full form of the number. Besides, what matters is the description of the task, not of the problem, and that clearly states to replace integers in the interval [0, 10] by their English words.
9th Nov 2020, 9:17 AM
Shadow
Shadow - avatar
0
But in the code we need to replace 10 with out
9th Nov 2020, 9:10 AM
sahil kulkarni
sahil kulkarni - avatar
0
Means I need to replace 0-10 numbers to words??
9th Nov 2020, 9:19 AM
sahil kulkarni
sahil kulkarni - avatar
0
💯
9th Nov 2020, 9:27 AM
sahil kulkarni
sahil kulkarni - avatar