Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # text = [x for x in input()]
- #
- # for i in range(len(text) - 3, - 1, -1):
- # previous = text[i + 1]
- # current = text[i]
- # if previous == current:
- # text.remove(text[i])
- #
- # print(''.join(text))
- text = [x for x in input()]
- for i in range(len(text) - 2, -1, -1):
- if text[i] == text[i + 1]:
- text.remove(text[i])
- print(''.join(text))
- text = [x for x in input()]
- for i in range(len(text) - 2, -1, -1):
- # if i == 0 and text[i] != text[i + 1]:
- # break
- if text[i] == text[i + 1]:
- text.pop(i)
- print(''.join(text))
Advertisement
Add Comment
Please, Sign In to add comment