python code to replace space with underscore and make capital code example Example: python replace space with underscore mystring.replace(" ", "_")