بکندباز

تابعی بنویسید که در عددی بین 1 تا 1000 را به عنوان آرگومان بگیرد. آن را به حروف تبدیل کرده و در خروجی برگرداند.

نمونه های ورودی و خروجی

numberstoletters(23) ➞ twenty three
numberstoletters(405) ➞ four hundred and five
numberstoletters(100) ➞ one hundred
numberstoletters(855) ➞ eight hundred and fifty five
numberstoletters(213) ➞ two hundred and thirteen

نکته: به and بعد از صدگان توجه شود

numberstoletters(23)  ➞ twenty three
numberstoletters(405)  ➞ four hundred and five
numberstoletters(100)  ➞ one hundred
numberstoletters(855)  ➞ eight hundred and fifty five
numberstoletters(213)  ➞ two hundred and thirteen

هنوز پاسخی برای این تمرین ثبت نشده است

نظرات

*
*