there is a motorcade:
a = ( '!' , ',' , ''? ') pre> and the line
Dasd, Sadarg! Ada How can you find characters from a motorcade in a line and remove them?
question@mail.ru
·
01.01.1970 03:00
there is a motorcade:
a = ( '!' , ',' , ''? ') pre> and the line
Dasd, Sadarg! Ada How can you find characters from a motorcade in a line and remove them?
answer@mail.ru
·
01.01.1970 03:00
For example, this:
& gt; & gt; & gt; a = ( ''! ', ' ',' , ''? ') & gt; & gt; s = 'dasd, sadarg! ada' & gt; & gt; & gt; '' .join ( filter ( lambda x: x not in a, s)) 'dasdsadargada' & gt; & gt; & gt; '' .join (x in s if x in a) 'dasdsadargada' pre> and in the other case we do not remove the symbols from the old line, but create a new line, which includes only those characters of the old line that satisfy the condition "" The X symbol is not included in the motorcade A "" (X not in A).