python if string in [] replace with underline code example Example: python replace space with underscore mystring.replace(" ", "_")