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)

30th May 2022, 5:48 AM
Mohamed Ayman
Mohamed Ayman - avatar
3 Answers
+ 2
Mohamed Ayman Your code is working well. Just print the output. print (new)
30th May 2022, 6:14 AM
FꫀâČ…áƒ«á„†ÍŸá„™á„‰áŻœ
FꫀâČ…áƒ«á„†ÍŸá„™á„‰áŻœ - avatar
30th May 2022, 6:16 AM
FꫀâČ…áƒ«á„†ÍŸá„™á„‰áŻœ
FꫀâČ…áƒ«á„†ÍŸá„™á„‰áŻœ - avatar
0
It works well for just 3 cases not all test cases , there is something wrong I haven't found it out yet
2nd Jun 2022, 2:01 PM
Mohamed Ayman
Mohamed Ayman - avatar