remove an element from string in python code example Example: remove a part of a string python url = 'abcdc.com' print(url.replace('.com',''))