Python program to input a digit and print it in words


Write a program in python to input a digit and print it in words.

--------------------------------------------

n=int(input("Enter the digit form 0 to 9 :- "))

print("Entered Digit is : ",end='')

if n==0:

    print("Zero")

elif n==1:

    print("One")

elif n==2:

    print("Two")

elif n==3:

    print("Three")

elif n==4:

    print("Four")

elif n==5:

    print("Five")

elif n==6:

    print("Six")

elif n==7:

    print("Seven")

elif n==8:

    print("Eight")

elif n==9:

    print("Nine")

else:

    print("Not a Digit")

--------------------------------------------

Output :-

Enter the digit form 0 to 9 :- 7

Entered Digit is : Seven

Post a Comment

0 Comments