Question: Python code for below problem using Dictionary elements ---------------------------------------------------- The Gocargo carriers are having a strong customer base in Germany and so wanted to start
Python code for below problem using Dictionary elements
----------------------------------------------------
The Gocargo carriers are having a strong customer base in Germany and so wanted to start the digitization in that branch. The POS installed in the waiting lounges of the company displays in English. The company wanted to translate the text displayed on the POS in German. Can you write an implementation for English to German translation. Note : Take a dictionary with English words as the key and the corresponding German word as the value. If the given sentence to be translated does not contain atleast one word in the dictionary, then display The sentence cannot be translated. Define a function convert() that takes the input string as its argument. Input Format: First Input consists of a dictionary that contains the English word as the key and the corresponding German word as the value.(The inputs contains a key and the corresponding value seperated by a space then a comma followed by the next word in the dictionary and so on ). Next input is a string that corresponds to the sentence to be translated. Output Format : Output the translated form of the input string, if the input string can be translated. Otherwise display The sentence cannot be translated. Refer sample input and output for further formatting specifications. Sample Input 1 : happy gott,new nytt,year at happy new year Sample Output 1 : gott nytt at Sample Input 2 : happy gott,new nytt,year at happy new year John Sample Output 2 : The sentence cannot be translated
-------------------------------------------------
Thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
