#Aufgabe 2 import re s1 = 'If the the problem is textual, use the the re module' pattern = r'\b(\w+)( \1\b)+' s2 = re.sub(pattern, r'\1', s1) print('s1:', s1) print('s2:', s2)