fork(1) download
  1. def swap_quotes(s: str) -> str:
  2. dict = { '"':"'", "'":'"' }
  3. return ''.join(dict.get(c, c) for c in s)
  4.  
  5. print(swap_quotes(input()))
Success #stdin #stdout 0.02s 9228KB
stdin
получает строку и заменяет " на ' и наоборот
stdout
получает строку и заменяет ' на " и наоборот