Advertisement
horozov86

Replace Repeating Chars

Mar 20th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. text = input()
  2.  
  3. result = text[0]
  4. for ch in text:
  5.     if ch == result[-1]:
  6.         continue
  7.  
  8.     result += ch
  9.  
  10. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement