Q. Write a program to convert a number entered by the user into its corresponding number in words.
For example, if the input is 876 then the output should be 'Eight Seven Six'.
(Hint. use dictionary for keys 0-9 and their values as equivalent words.)
Answer :-
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 = " ")
Output :-
Enter a number :- 876
Eight Seven Six
>>>
Eight Seven Six
>>>
Enter a number :- 15
One Five
>>>
Enter a number :- 46536
Four Six Five Three Six
>>>
Can u pls type the output of this ques...?
ReplyDeleteCopy the code run it in your IDLE python : )
Deleteokkee
ReplyDelete: )
DeleteWill I get 5marks by writing this much only because in a sample paper this Q. Was there in the 5 marks section.
ReplyDeleteYes , : )
Deletegot it?
ReplyDeleteWhat
DeleteMam it doesn't work on the application
ReplyDeletenot working
ReplyDeleteIt is working please run in your idle python.
Deletethx to who ever created this content:)
ReplyDeleteWelcome 😊😊😊
DeleteI want to work with uh.
ReplyDeleteBut Why ??
DeleteHow to write this program using function?
ReplyDeleteJust write all logic in function.
Deleteits good,thanks
ReplyDeleteWelcome : )
Deletecan u pls write like using tens, for eg 765 its seven sixty five ,pretty pls give it 😊
ReplyDeleteBut it will become lendi answer.
Deletestfu nerd 🤓🤓
Deletewill i get full marks of only this much answer .the ques was of 6 marks
ReplyDeleteYes,
Deleteaag laga diya
ReplyDeleteThankyou : )
DeleteBroooo its not dic (k) its dict for dictionary
ReplyDeleteyour name is on fbi list, i am an fbi agent, out of sympathy to you i want you to be careful. helicopters will land on your house, so go to another country and hide your identity. peace
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )