+ 1

Have anyone solved the "No Numeral" problem in python?

Except the test case 3, all other test cases are passed. I can't figure out the problem. sen = input() senti = [] for n in sen: if n == "0": senti.append("no") elif n == "1": senti.append("one") elif n == "2": senti.append("two") elif n == "3": senti.append("three") elif n == "4": senti.append("four") elif n == "5": senti.append("five") elif n == "6": senti.append("six") elif n == "7": senti.append("seven") elif n == "8": senti.append("eight") elif n == "9": senti.append("nine") elif n == "10": senti.append("ten") else: senti.append(n) for i in senti: print(i,end="")

20th May 2020, 3:53 AM
Nafiz Imtiaz
Nafiz Imtiaz - avatar
6 Réponses
+ 1
Post your code so that we can see
20th May 2020, 4:01 AM
Abhishek Tandon
Abhishek Tandon - avatar
+ 1
I've inserted the code
20th May 2020, 4:24 AM
Nafiz Imtiaz
Nafiz Imtiaz - avatar
0
Yes why not many and many of peoples have solved it . Show us your try so that we can help you.
20th May 2020, 4:00 AM
Ayush Kumar
Ayush Kumar - avatar
0
Write 10 case before 1. Otherwise it is read as 1 and 0.. Edit: And also 10 is not char.. It's a string so use split method.. By that approach, order is not a matter also..
20th May 2020, 6:01 AM
Jayakrishna 🇮🇳
0
case 0 print zero
20th May 2020, 6:03 AM
Jobemar Arreaza
Jobemar Arreaza - avatar