how to remove some characters from a string in python

31

s = 'abc12321cba'

print(s.replace('a', ''))
>>> string = 'This is a string, with words!'
>>> string.split()
['This', 'is', 'a', 'string,', 'with', 'words!']

Comments

Submit
0 Comments