using underscore as replacing a string in python code example Example: space to underscore python mystring.replace(" ", "_")