python replace spaces in end code example Example: replacing spaces in a string python mystring.replace(" ", "_")