0
What is wrong in this code?
text = input().lower() lst = text.split(" ") dict = {"0":"zero","1":"one","2":"two","3":"three", "4":"four","5":"five","6":"six","7":"seven", "8":"eight","9":"nine","10":"ten"} new_lst = [] for i in lst: if i in dict : new_lst.append(dict[i]) else: new_lst.append(i) new = " ".join(new_lst)
3 Answers
+ 2
Mohamed Ayman
Your code is working well. Just print the output.
print (new)
0
You can try this: https://code.sololearn.com/ci7a04305SQy/?ref=app
0
It works well for just 3 cases not all test cases , there is something wrong I haven't found it out yet