0

I don't get y this isn't working for the no numerals challenge!

numbers = { '0':'zero', '1':'one', '2':'two', '3':'three', '4':'four', '5':'five', '6':'six', '7':'seven', '8':'eight', '9':'nine', } strg = input() def method1(string): string = list(string) for char in string: if char in '1234567890': string[string.index(char)] = numbers.get(char) fixedStrg = str() for i in string: fixedStrg += i return fixedStrg print(method1(strg))

23rd Feb 2020, 10:20 PM
( Deleted Account )
( Deleted Account ) - avatar
3 odpowiedzi
+ 5
Not forgot the number 10
23rd Feb 2020, 10:26 PM
Cmurio
Cmurio - avatar
+ 2
what happen if the number is 15 ? will it become onefive ? see the task again, i'm pretty sure its only convert if ten or less https://www.sololearn.com/discuss/2145385/?ref=app https://www.sololearn.com/discuss/2136365/?ref=app
23rd Feb 2020, 10:36 PM
Taste
Taste - avatar
0
i see, thank you!
23rd Feb 2020, 10:51 PM
( Deleted Account )
( Deleted Account ) - avatar