What is wrong with my Python code? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 6

What is wrong with my Python code?

Coding challenge "No Numerals" fails on test cases 3-6 https://code.sololearn.com/cG5O3v59KyVq/?ref=app It can write all numbers. Cannot understand the problem. Challenge description: 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 Explanation: You would update the phrase to change '2' to 'two' and '3' to 'three'.

16th Nov 2021, 4:29 PM
Adam Aksu
Adam Aksu - avatar
10 Respuestas
+ 5
Adam (Aydin) Aksu try again once now.. code is fine for problem..
16th Nov 2021, 6:04 PM
Jayakrishna 🇮🇳
+ 7
Adam , the code runs fine for me, no issues. have you any doubts ?
16th Nov 2021, 5:48 PM
Lothar
Lothar - avatar
+ 2
Why first line is commented ? You need take input , comment 2nd line..!
16th Nov 2021, 5:32 PM
Jayakrishna 🇮🇳
+ 2
Hi Jayakrishna🇮🇳 It is for testing purpose. To be able to run the code outside the challenge itself..
16th Nov 2021, 5:33 PM
Adam Aksu
Adam Aksu - avatar
+ 2
Hi Lothar It runs fine, I know. This is my solution for challenge "No Numerals". Running it in the challenge itself it won't pass all test cases. Only passes test case 1 and 2 of 6 test cases.
16th Nov 2021, 5:53 PM
Adam Aksu
Adam Aksu - avatar
+ 2
Jayakrishna🇮🇳 Hmm. Very strange. Now it passed all test cases.
16th Nov 2021, 7:12 PM
Adam Aksu
Adam Aksu - avatar
+ 1
May be network issue... Some times happens here...
16th Nov 2021, 7:15 PM
Jayakrishna 🇮🇳
+ 1
Yes, probably. Thanks!
16th Nov 2021, 7:15 PM
Adam Aksu
Adam Aksu - avatar
+ 1
You're welcome..
16th Nov 2021, 7:16 PM
Jayakrishna 🇮🇳
+ 1
Thats working fine
17th Nov 2021, 8:53 AM
Satish Kumar
Satish Kumar - avatar