text: <<
  Allison Seim1,625 Points
  how to split a string without a separator
  how to match an alphabet of a string with the key of a dictionary' } a = list(word) for i in a: if i == morse_dict.keys(): return (morse_dict.values()) # enter your code below morse_code("govern")
  1 Answer
  Chris FreemanTreehouse Moderator 67,736 Points
  Hey Allison Seim.
  Strings can certainly be
  split, but not with an empty separator:
  >>> "abcde".split('') Traceback (most recent call last): File “<stdin>”, line 1, in <module> ValueError: empty separator
  The Pythonic way is to treat the string as a container, like a
  list. A
  str has an
  __iter__ method that will yield one character at a time.
  So, you can do:
  >>> list("abcde") [‘a’, ‘b’, ‘c’, ‘d’, ‘e’] >>> for char in "abcde": ... print(char) ... a b c d e
  Your
  list(word) is perfect.
  Since the whole alphabet is in
  morse_dict you don’t need the
  if, simply look up the character
  morse_dict[i]. The append this result to a list that can be later joined into a string. (Be sure to use a hyphen when joining)
  Post back if you need more help. Good luck!!!
  Lening Li689 Points
  Lening Li689 Points
  You can just do:
  morse_dict.get(alphabet, '')