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
When you run your Windows Form application, what is the lifespan of a global variable (also known as a "field" or "class" variab
Goryan [66]

The lifespan of a global variable (also known as a "field" or "class" variable) exist only until any additional classes are initialized.

<h3>What is Windows form application?</h3>

Windows Forms is defined as a form of UI backbone that is often uused for creating Windows desktop apps.

It is known to help its user in a lot of ways to produce or make  desktop apps using  the visual designer given in Visual Studio. It has a lot of Functionality such as drag-and-drop placement of visual controls and others.

See full question below

When you run your Windows Form application, what is the lifespanof a global variable (also known as a “field” or “class”variable)?

a. during the initial click button event

b. global variables only exist if they are constants

c. only until any additional classes are initialized

d.as long as the form is running

Learn more about Windows  from

brainly.com/question/26420125

5 0
2 years ago
A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attendi
juin [17]

Answer:

The answer is "Option A".

Explanation:

In this question, the choice "A" is correct because in this a conditional if block statement is used that that use "IsFound" method that takes two parameters "afternoonList and Child" in its parameter and use the append method that takes "lunchList and child" in parameter and add values, that's why other choices are wrong.

3 0
2 years ago
Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
Fantom [35]

Answer:The 2009-M57-Patents scenario tracks the first four weeks of corporate history of the M57 Patents company. The company started operation on Friday, November 13th, 2009, and ceased operation on Saturday, December 12, 2009. As might be imagined in the business of outsourced patent searching, lots of other activities were going on at M57-Patents.

Two ways of working the scenario are as a disk forensics exercise (students are provided with disk images of all the systems as they were on the last day) and as a network forensics exercise (students are provided with all of the packets in and out of the corporate network). The scenario data can also be used to support computer forensics research, as the hard drive of each computer and each computer’s memory were imaged every day.

Explanation:

4 0
3 years ago
What should you use as the argument for the goto() command?
Soloha48 [4]
D. The X and Y coordinates of a point 

goto(21,60)

will make the turtle go to that specific location.
7 0
3 years ago
Which steps of the management science process can either be a recommended decision or information that helps a manager a decisio
Step2247 [10]
Probably c or a with the question your asking
8 0
2 years ago
Other questions:
  • Unix has experimented with several security programs. a user can attach a watchdog program to a file that grants or denies acces
    13·1 answer
  • _____________ data is what is translated to digital format so it can be stored in a computer.
    10·1 answer
  • This type of software works with end users, application software, and computer hardware to handle the majority of technical deta
    12·1 answer
  • The icon below represents the ____________.
    8·1 answer
  • If a fire should break out in your building, which of the following actions is NOT recommended?
    10·2 answers
  • Match the job description to the level of degree it requires.
    15·1 answer
  • Breaking code rules is only a problem once in a while. Group of answer choices True False
    12·1 answer
  • What Is entered into the system as input?
    13·1 answer
  • What is the output of the following program? If there is any problem, how can
    13·1 answer
  • What is the complete path and filename of the file where ports and their associated protocols are defined
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!