Write a Python program (called q3.py) that given an integer from 0 to 1,000 does the "4 is magic" transformation. The steps are as follows. Convert the integer n into English and count the number of...

Write a Python program (called q3.py) that given an integer from 0 to 1,000 does the "4 is magic" transformation. The steps are as follows. Convert the integer n into English and count the number of letters (i.e. 21 is "twenty one" and consists of 9 letters, 102 is "one hundred two" and consists of 13 letters, 1000 is "one thousand" and consists of 11 letters). Let n_len be the length of the English word equivalent for the integer n. If n_len is 4, output "four is magic." Then, terminate the transformation process.

Jan 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here