how to replace space with empty string in python code example Example: replace space with . pyhton mystring.replace(" ", "_")