+ 2
How can I print ten with this code
This code just prints one0 but how can I do it to print ten not one0 This is the code: def no_numerals(phrase): translation = "" number_letters = { "1": "one", "2": "two", "3": "three", "4": "four", "5": "five", "6": "six", "7": "seven", "8": "eight", "9": "nine", "10": "ten", } for letter in phrase: if letter in number_letters: translation = translation + number_letters[letter] else: translation = translation + letter else: print(translation) no_numerals(str(input()))
17 ответов
+ 2
Thank a lot
+ 1
Nirmalya Bakshi It works thanks just that I can'mix it with other letters
+ 1
Nirmalya Bakshi Doesn't work
+ 1
Nirmalya Bakshi how would it work in the same line
+ 1
Nirmalya Bakshi there is not one space between them
+ 1
Yes
+ 1
Nirmalya Bakshi there is a problem you can't do as the function you can print numbers alone but you can't do it mixed with other strings or different texts apart from the ones in the dictionary
See I want this that will make me to be able to do this
##hello 10 outputs with the function
##Hello ten
##hi bro 3
##hi bro three
thanks