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
Bond [772]
3 years ago
11

Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j

ust like this would be used in a speech recognition system (e.g. automated phone taxi bookings) to convert a spoken number into an integer value. Here is an attempt that won't work. Your task is to replace the function body with something that works:

Computers and Technology
2 answers:
Lelu [443]3 years ago
4 0

Answer:

see explaination

Explanation:

def words2number(s):

words = s.split()

numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

result = ""

for word in words:

if word in numbers:

result += str(numbers.index(word))

return result

nikitadnepr [17]3 years ago
4 0

Answer:

Check the explanation

Explanation:

def words2number(s):

   words = s.split()

   numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

   result = ""

   for word in words:

       if word in numbers:

           result += str(numbers.index(word))

   return result

# remove below test line before submitting this code.

print(words2number('one five two'))

Kindly check the attached image below for the code output.

You might be interested in
Who was one of the founders of the location sharing site Foursquare​
Shalnov [3]

One of the founders of Foursquare is Dennis Crowley. The other is Naveen Selvadurai. I know you didn't ask for both but I wanted to give them to you just in case. I hope this helps! (:

7 0
2 years ago
State and explain three importance of internet education​
Ne4ueva [31]

Answer:

It can improve the quality of education in many ways. It opens doorways to a wealth of information, knowledge and educational resources, increasing opportunities for learning in and beyond the classroom. Teachers use online materials to prepare lessons, and students to extend their range of learning

Explanation:

4 0
2 years ago
Read 2 more answers
3) How ash traditional technology and modern
Fynjy0 [20]

Answer:

While the developed world benefits from the modern explosion of technology, countries like Ethiopia continue to rely on their forefathers' methods for important daily tasks such as farming, cooling, and providing clean water. These activities are often physically challenging, time and energy intensive, and are often carried out by female family members in many such societies. Furthermore, they can damage the local ecology and climate, such as deforestation and soil erosion caused by the use of trees for firewood. Western technologies are often too complicated, expensive, unacceptable, and difficult to maintain in developing societies, so they are of little or no use in these situations.

4 0
2 years ago
Carlie was asked to review a software prject for her company and determine what materials are needed. Whihc part of project mana
Helga [31]

Answer:

The answer is "Resources".

Explanation:

All services should definitely be reviewed through Carlie. However many Software Developers, Reviewers, and others are accessible are important to find out. Only then can Carlie find out because needed, the exact timelines. Because whenever establishing precise deadlines, she needs to take a look at the tools, that's why the above given choice is correct.

8 0
3 years ago
Subtract 01101011-00101010
White raven [17]

Answer:

Alexa says minus 8

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • What was the impact of the rise of the Japanese auto industry and the semiconductor industry in south eastern​ Asia? A. It incre
    13·1 answer
  • Consider a channel that can lose packets but has a maximum delay that is known. Modify Protocol rdt2.1 to include sender timeout
    11·1 answer
  • Frank develops a questionnaire for his study on Internet dating. One of his questions asks, "How do you feel about Internet dati
    14·2 answers
  • Select the correct answer.
    15·1 answer
  • What is boolean rules​
    12·1 answer
  • What was original name<br> whoever answers first gets brainly crown
    9·1 answer
  • Setting up a desktop computer for anAutoCADspecialist who needs a minimum of 125 GBram which operating system would be the best
    5·1 answer
  • Which statements are true? Select 4 options.
    9·1 answer
  • ¿por que hay peligros en internet?
    11·1 answer
  • Task 2
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!