Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def duplicate_encode(word):
- characters = list(word)
- for c in characters:
- if word.count(c) < 2:
- word.replace(c, "(")
- else:
- word.replace(c, ")")
- return word
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement