0

Can't find my error - Python

I'm trying to solve a challenge. The code should replace digits in a string with respective words, eg. 'there are 5 cups' to 'there are five cups'. It fails one of the tests and I can't figure out why. I know it's a crude code, but I think it should work. https://code.sololearn.com/czOCAxhltvMg/?ref=app

20th Mar 2020, 9:58 PM
Pavel
Pavel - avatar
8 Answers
+ 2
Pavel remember 10 should come back as ten not onezero
20th Mar 2020, 10:13 PM
BroFar
BroFar - avatar
+ 1
Thanks BroFar, I need to read the instructions properly. Fixed it.
20th Mar 2020, 10:24 PM
Pavel
Pavel - avatar
+ 1
Pavel it is not fixed ... please keep trying... you will get it.
20th Mar 2020, 10:27 PM
BroFar
BroFar - avatar
+ 1
Pavel look at this link https://ibb.co/PN26TwK
20th Mar 2020, 10:34 PM
BroFar
BroFar - avatar
+ 1
BroFar yeah I fixed it in the challenge but forgot to change one line in the code that I linked to. Now it's ok here as well. I guess I have to work on my punctuality :-)
20th Mar 2020, 11:00 PM
Pavel
Pavel - avatar
+ 1
Pavel 👌👍
20th Mar 2020, 11:04 PM
BroFar
BroFar - avatar
0
BroFar I really believe I did. I replace 10 first and then replace 1 and 0 after that, so there should be no problem.
20th Mar 2020, 10:29 PM
Pavel
Pavel - avatar