Dictionaries and List Comprehension
The following code is incorrect. You must fix it.
Create a dictionary D2.
Add the following key-pairs to the dictionary.
1. Use a list comprehension to loop through the words andreplace them with the definition in dictionary D2, if there is one.Otherwise, keep the original word. Call the resulting list h2.
2. Join all the words in h2 with a space between each word, callit h3
3. Define a function, translate_dict that takes a string, inputS, and dictionary input D and replaces any words in S that are in Dwith their definitions from D2.


in
PayPal Gateway not configured
PayPal Gateway not configured