Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def duplicate_encode(word):
  2.     characters = list(word)
  3.     for c in characters:
  4.         if word.count(c) < 2:
  5.             word.replace(c, "(")
  6.         else:
  7.             word.replace(c, ")")
  8.     return word
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement