1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ANTONII [103]
3 years ago
10

Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N

ine’) # Expand this into a tuple o Example: 1234 would be converted to One Two Three Four
Computers and Technology
1 answer:
prohojiy [21]3 years ago
7 0

Answer:

  1. def convertStr(num):
  2.    Number = ("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine")
  3.    numStr = str(num)
  4.    output = ""
  5.    for x in numStr:
  6.        index = int(x) - 1
  7.        output += Number[index] + " "
  8.    return output
  9. value = 1234
  10. print(convertStr(value))

Explanation:

Firstly, create a function convertStr that take one input number (Line 1).

This function convert the input number to string (Line 3) and then use for-loop to traverse through the individual digit (Line 6). In the loop, get the target index to extract the corresponding digit letter from the Number tuple(Line 7). The target index is always equal to the current digit number - 1. Next, join the extracted digit letter from the tuple to an output string (Line 8) and return it at the end of the function (Line 10).

We test the function using 1234 as argument (Line 12 - 13) and we shall get One Two Three Four

You might be interested in
Database Management Systems are featured with:
Olin [163]

Answer:

Answer: Database Management Systems are featured with:​ The ability to store a large amount of data to facilitate easy updates, short, and retrieval.

Explanation: I took the test

6 0
3 years ago
Read 2 more answers
Only people who have nitrotype answer this question!!!
grigory [225]

Answer:

Krampus 4k Nitrotype team- VVIXEN

3 0
3 years ago
Read 2 more answers
Your manager is very interested in having a new version of an OS, and wants you to install a beta version to use on a server so
vova2212 [387]

Answer:

d. A safer path is to wait for an official release and to avoid using a beta system in a production environment.

Explanation:

Beta version: This is a pre-release of software that is given out to a large group of users to try under genuine conditions. Beta versions have gone through alpha testing inhouse and are generally fairly close in look, feel and function to the final product; however, design changes often occur as a result.

3 0
3 years ago
Janeal spends her day looking at the stock and bond markets and evaluating how the portfolios of the businesses she serves will
pychu [463]

Answer:

ur answer good sir will be : financial analyst

and a brainliest will be good to thnx

4 0
4 years ago
Why OSI is called open system?
MAXImum [283]

Answer: OSI system is called Open System Interconnection because It provides the collection of protocols for the connection of different system to connect with  any dependence on any other system or network.

Explanation: Open system interconnection establishes a connection between the different system for the communication purpose using several protocols and software standards .It has no dependency or any network or other system to do the functioning and works using the seven layers of the OSI architecture.Thus, that is why OSI system known as open system.

7 0
4 years ago
Other questions:
  • What is a good monitor for console gaming? (Any price)
    13·2 answers
  • I need some cool things to do with windows command prompt.
    13·1 answer
  • Which section of a personal narrative requires the most development
    9·1 answer
  • We can log on to computer or to network through s creen<br>​
    7·1 answer
  • Brian's father drives a car that uses voice commands for navigation. Which Al application field is Brian's father using?
    11·1 answer
  • There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
    5·1 answer
  • An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
    14·1 answer
  • How are satellite radio, Internet radio, and podcasting different?
    11·1 answer
  • Give a regular expression for binary numbers. They can be integers or binary fractions. A leading - sign is always allowed. Lead
    15·1 answer
  • Yazmin is reading a book that has 74 pages. She has read 38 pages. How many more pages does she need to read to finish the book​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!