Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
Introduction
Dictionary basics
Dictionaries in loops and conditional statements
Dictionaries in functions
Summary
18. Exercise 2

Instruction

Great! How about this one?

Exercise

You are given a dictionary that maps letters and digits to Morse code. Write a function named translate_into_morse() that takes a string as an input parameter and returns its Morse representation. If a given character is not available in the dictionary, return it "as it is". Don't forget to uppercase the input string to match our morse dictionary! 😉

Stuck? Here's a hint!

Use the following line to change the case of a string:

text = text.upper()