Q. Write a short program to input a digit and print it in words. Paste your code below.

(Hint Make use of if statements)


Answer =


a = int (input ("enter the digit (1-10) = "))
if a ==1 :
  print ("one ")
elif a ==2 :
  print ("two")
elif a ==3 :
 print ("three")
elif a == 4:
  print ("four  ")
elif a == 5:
  print ("five")
elif a == 6:
  print ("six ")
elif a == 7:
  print ("seven")
elif a == 8:
  print ("eight ")
elif a == 9:
  print ("nine")
elif a == 10 :
  print ("ten")
else:
  print ("digit is out of range ")

1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post