this code should be in python: You should be using dictionaries for this question: Morse code: (A-Z) [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","-...


this code should be in python:


You should be using dictionaries for this question:


Morse code: (A-Z)


[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","- -","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.-- ","--.."]


You are supposed to implement a function that takes a list of strings as its only parameter (called “words”). Each of the words can be transformed to Morse code by concatenation of several numbers in the above strings (without spaces).


For example, the transformation of “ab” will be “.--...” (“.-” + “-...”). The word “ems” will also have the same transformation “.--...” (“.” + “--” + “...”). In this function, the goal is to return the number of the unique transformations in the “words” list. Here is an example (none of this is needed to be printed, the function will only return one integer):



Words = [“ab

Extracted text: Words = [“ab", “a", “ems"] Returned value: 2 Explanation: the transformation of each word is: "ab" = “a" %3D "ems" = " There are a total of 2 unique transformations: ““. --. and ". -".

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here