Answer:
Check the explanation
Step-by-step 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.