Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For python In the real world and common usage, a physical dictionary is a collection of words matched with their definitions. Given a word, you

image text in transcribedFor python

In the real world and common usage, a physical dictionary is a collection of words matched with their definitions. Given a word, you can look up its definition in a dictionary. Write a function that will take a dictionary and a list of words in English and return a translated version of the list. If any word is not found in the dictionary, you do not need to translate it and just add it to the list as is. The dictionary's keys will be the word in English and its values are the translated verion. The function should: be named translate() take two arguments, a dictionary and a list of words return a list with translated words # YOUR CODE HERE Graded Read Only input_string = "hello world my first program" spanish = dict() spanish['hello'] = 'hola' spanish['yes'] = 'si' spanish['first'] = 'primer spanish['two'] = 'dos' spanish['world'] = 'mundo' spanish['red'] = 'rojo' spanish['black'] = 'negro spanish['green'] = 'verde spanish['my'] = 'mi' str_result = print(input_string, " ", ' '.join([str(elem) for elem in translate(spanish, list(input_string.split(" "))))))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

LO6 Describe how individual pay rates are set.

Answered: 1 week ago