I wrote a code that removes duplication in a string, but the problem is in the condition I have an error: index is out of range! The input is: rooobert and output: robert
n = list(input())
s=[]
for i in range(0,len(n)-1):
if n[i] == n[i+1]:
n.remove(n[i])
print(n)