+ 1
Why do i get two cases wrong in the No numerals Code coach challenge. Here's my code
prompt= input('').lower() list= prompt.split(' ') string = " " dic = { '1':'one' , '2':'two', '3':'three', '4':'four','5':'five', '6':'six' , '7':'seven', '8':'eight', '9':'nine', '10':'ten'} for word in list: for key in dic: if word == key: index= list.index(word) list[index]= dic[key] print(string.join(list))
3 Réponses
+ 1
You need to change your code slightly so that it does not return "onetwo" for the number 12 or "twofive" for the number 25.
+ 1
The code doesn't out 12 as "one two" it outputs it as "12" .. only numbers below 10 it converts. Copy the code and try it out. You'll see it works fine... I just wonder why it doesn't pass case 4&5 .. please copy and run the code you'll see. Thanks
+ 1
I need to get to the bottom of this. please