Advertisement
pacho_the_python

Untitled

Mar 31st, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. some_string = input()
  2.  
  3. key_list = []
  4.  
  5. for i in some_string:
  6.     if i.isdigit() or i.isalpha():
  7.         key_list.append(i)
  8.     else:
  9.         key_list.extend(f"\\{i}")
  10.  
  11. key = "".join(key_list)
  12.  
  13. print(key)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement