Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

MY PROGRAMMES

Sunday, April 16, 2023

DIGIT TO WORD CONVERSION

f=int(input("Enter the number of digits in the number = "))
n=int(input("Enter the number = "))
if f==3:
    q3=n%10
    n=n//10
    q2=n%10
    n=n//10
    q1=n%10
    n=n//10
    if q1==1: print("One")
    elif q1==2: print("Two")
    elif q1==3: print("Three")
    elif q1==4: print("Four")
    elif q1==5: print("Five")
    elif q1==6: print("Six")
    elif q1==7: print("Seven")
    elif q1==8: print("Eight")
    elif q1==9: print("Nine")
    elif q1==0: print("Zero")
    else: print("It is a wrong number")
    if q2==1: print("One")
    elif q2==2: print("Two")
    elif q2==3: print("Three")
    elif q2==4: print("Four")
    elif q2==5: print("Five")
    elif q2==6: print("Six")
    elif q2==7: print("Seven")
    elif q2==8: print("Eight")
    elif q2==9: print("Nine")
    elif q2==0: print("Zero")
    else: print("It is a wrong number")
    if q3==1: print("One")
    elif q3==2: print("Two")
    elif q3==3: print("Three")
    elif q3==4: print("Four")
    elif q3==5: print("Five")
    elif q3==6: print("Six")
    elif q3==7: print("Seven")
    elif q3==8: print("Eight")
    elif q3==9: print("Nine")
    elif q3==0: print("Zero")
    else: print("It is a wrong number")
elif f==4:
    q4=n%10
    n=n//10
    q3=n%10
    n=n//10
    q2=n%10
    n=n//10
    q1=n%10
    n=n//10
    if q1==1: print("One")
    elif q1==2: print("Two")
    elif q1==3: print("Three")
    elif q1==4: print("Four")
    elif q1==5: print("Five")
    elif q1==6: print("Six")
    elif q1==7: print("Seven")
    elif q1==8: print("Eight")
    elif q1==9: print("Nine")
    elif q1==0: print("Zero")
    else: print("It is a wrong number")
    if q2==1: print("One")
    elif q2==2: print("Two")
    elif q2==3: print("Three")
    elif q2==4: print("Four")
    elif q2==5: print("Five")
    elif q2==6: print("Six")
    elif q2==7: print("Seven")
    elif q2==8: print("Eight")
    elif q2==9: print("Nine")
    elif q2==0: print("Zero")
    else: print("It is a wrong number")
    if q3==1: print("One")
    elif q3==2: print("Two")
    elif q3==3: print("Three")
    elif q3==4: print("Four")
    elif q3==5: print("Five")
    elif q3==6: print("Six")
    elif q3==7: print("Seven")
    elif q3==8: print("Eight")
    elif q3==9: print("Nine")
    elif q3==0: print("Zero")
    else: print("It is a wrong number")
    if q4==1: print("One")
    elif q4==2: print("Two")
    elif q4==3: print("Three")
    elif q4==4: print("Four")
    elif q4==5: print("Five")
    elif q4==6: print("Six")
    elif q4==7: print("Seven")
    elif q4==8: print("Eight")
    elif q4==9: print("Nine")
    elif q4==0: print("Zero")
    else: print("It is a wrong number")
else:("It is a wrong number")