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