Reverting colored text back into default text

How do I revert colored text back into its default color? :

Whenever I am using the ANSI color codes (as recommended by the Replit Python Tutorial), I am able to perfectly execute it into the executor and it shows up with, for instance, a green text due to the use of:

"\033[032m This code displays green text \n".

However, the problem that I am confront with is that whenever I use code like aforementioned, when displaying some other code afterwards, it still shows up as green code.

Does anyone have any suggestions on how I can fix this?
Thank you in advance! :smiley:

Repl link: https://replit.com/@AnishBhandi/day-14100-days#main.py

print("\033[31m πŸ“’ Please read the directions and try again. πŸ“’")

print()

print("Now that you know your ability, you can use it against Mr.Roombastic ONLY ONCE throughout the match to nullify him for a brief time.")
print("You can simply activate it by typing 'Y' or 'Yes' when the refferree asks if you want to use your ability before Mr. Roombastic's turn.")

All help is appreciated!

1 Like

Hi,

In order to reset the colors back to its defaults, use \u001b[0m!

Python:

print(β€œ\033[0m”)

C++:

std::cout << β€œ\033[0m” << β€œtext”;

Image and I learned this from Bookie0’s post: https://replit.com/talk/ask/how-do-i-change-the-color-of-the-text-on-c/137999

Please mark as the solution and like the post if it helped :+1: