python change space to underscore code example Example: space to underscore python mystring.replace(" ", "_")