+ 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="")
6 Answers
+ 1
Post your code so that we can see
+ 1
I've inserted the code
0
Yes why not many and many of peoples have solved it . Show us your try so that we can help you.
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..
0
case 0 print zero