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