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