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
Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
juin [17]

Answer:True

Explanation:

Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, managers struggle with the challenge of turning their business data into business intelligence.Data in its raw form does not help managers in reaching their business decisions. In this electronic age data collection has been made simple .However the value of that data can only be seen when it is processed and it becomes information. It can help managers to make quick business decisions that will be used to make come up with important business strategies  .It follows that when data is collected in its various forms it should then be processed meaning that the business managers can either use business Intelligent software  that can present the data in a meaningful form like graphs . pie charts and other forms that can be easily interpreted and reflect the trends that have been presented by the raw data .The organisation should find value in the data that they have collected and tell the story that leaves in the data.

7 0
3 years ago
What type of major application has most changed the way people interact in their daily lives?
kogti [31]
Social media, Facebook has become really popularized as has youtube and tumblr. Many people communicate through messenger on facebook, videos on youtube and just posting different things on tumblr. The way people put themselves out into the world, and portray who they are to people across the world is huge change from say 20 years ago.
5 0
3 years ago
Imagine how the situation could be handled. Come up with as many ideas as possible: There's no one "right" answer! Then, highlig
Veseljchak [2.6K]

Answer:

there is no passage

Explanation:

6 0
3 years ago
WILL GIVE BRAINLIEST AND HALLOWEEN CANDY!!!!!!!!!<br> who wants to talk?
Tamiku [17]
<h2>Sure, I wanna talk. (:      .........................</h2>
3 0
3 years ago
In the Dynamic Partitioning technique of memory management, the placement algorithm that scans memory from the location of the l
Shtirlitz [24]

Answer:

best-fit

Explanation:

Best-fit: Closest in size to the request: In the Dynamic Partitioning technique of memory management, the placement algorithm that scans memory from the location of the last placement and chooses the next available block that is large enough to satisfy the request

3 0
3 years ago
Other questions:
  • Which is the best description of a hierarchical report?
    13·1 answer
  • Which type of architecture places a firewall in front of the VPN to protect it from Internet-based attacks as well as behind a f
    6·1 answer
  • ____ is an object-oriented programming language from Sun Microsystems which allows small programs called applets to be embedded
    13·1 answer
  • Which programming language looks similar to human languages?
    12·1 answer
  • If you enjoy exploring,"what would happen if"types of questions and activities,a career in science or technology might be a good
    7·1 answer
  • How does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
    6·1 answer
  • Question 2 (5 points)
    12·1 answer
  • A technician recently fixed a computer with several viruses and spyware programs on it and notices the Internet settings were se
    15·1 answer
  • Gigantic Life Insurance is organized as a single domain. The network manager is concerned that dividing into multiple domains to
    15·1 answer
  • Después de un incidente de seguridad del cliente, el equipo realiza un análisis en profundidad de cada paso dado por los atacant
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!