Ask coding questions

← Back to all posts
Could somebody tell me how to add colors to this repl?
GhostKingNico (10)

I'm trying to make the text green but I am not sure how to???? How do I make the colors random?

Comments
hotnewtop
[deleted]

Here is more information over how to use colors:

https://replit.com/talk/learn/Python-Text-Styles/118062

[deleted]

To make green color use:

print("\033[32mGreen")

InvisibleOne (2934)
PURPLE = '\033[95m'
CYAN = '\033[95m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
ITALIC = '\033[3m'
FAINT =  '\033[2m'
NORMAL = '\033[22m’

Just put that into your repl, and then you can print stuff like:

#green
print(GREEN + "This will be green text!")
#blue
print(BLUE + "This will be blue text!")
#red
print(RED + "This will be red text!")