Answers for "Write a program to convert a number entered by the user into its corresponding number in words. For example, if the number is 876, then the output should be ‘Eight Seven Six’"

0

Write a program to convert a number entered by the user into its corresponding number in words. For example, if the number is 876, then the output should be ‘Eight Seven Six’

num = input ("enter a number = ")

dic = { "0" : "zero" , "1":"one " , "2" : "two" , "3" : "three" , "4" : "four" , "5" : "five" , "6" : "six" , "7" : "seven" , "8" : "eight" , "9" : "nine"}

for i in num :
      print( dic[ i ], end = " ")
Posted by: Guest on May-24-2021

Code answers related to "Write a program to convert a number entered by the user into its corresponding number in words. For example, if the number is 876, then the output should be ‘Eight Seven Six’"

Python Answers by Framework

Browse Popular Code Answers by Language