Strings in Python are immutable and they can not be changed. Because of this, the effect of line.replace(...) is just to create a new string, rather than changing the old one. You need to assign it to line in order to have that variable take the new value, with those characters removed.
Or
You can use a regular expression replacement with re.sub method:-
import re
line = re.sub('[!@#$]', '', line)
To know more about this you can have a look at the following video tutorial:-