my code:
def word_distribution(stringeling):
for char in "?!.,":
Satz = stringeling.replace(char,"")
return Satz
print(word_distribution("Hallo du Peter? Du! und punkt. und komma,"))
output: Hallo du Peter Du! und punkt. und komma
The code does only remove the first "?" Why when i use the for loop without the function it prints me all the word without punctuation. Thanks for help ;)