matbiz01

Untitled

Dec 3rd, 2021
639
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def parse_string(str):
  2.     dict = {
  3.         "a": "A",
  4.         "b": "B",
  5.         "c": "C"
  6.     }
  7.     no_space = [x for x in str if x != " "]
  8.     result = ""
  9.     for letter in no_space:
  10.         if letter in dict:
  11.             result += dict[letter]
  12.         else:
  13.             result += letter
  14.     return result
RAW Paste Data