Skip to content
Sign upLog in
← Back to Community

how to add colour

Profile icon
Leroy01010

how can you add colour to a text in python

Answered by Bookie0 [earned 5 cycles]
View Answer
Voters
Profile icon
ShivaumLakhani1
Profile icon
Leroy01010
Comments
hotnewtop
Profile icon
Bookie0

here check this out fro the colors in python: https://repl.it/talk/learn/Add-ons-to-your-Python-code-to-make-it-better/35792

basically if i have these colors:

green = "\033[0;32m" # to print colored text: print ("hi there "+ green + "bob!")

Happy coding and hope this helps! =)

Profile icon
Leroy01010

thanks much easier

@Bookie0

Profile icon
Bookie0

cool! ;)

@Leroy01010

Profile icon
Coder100

Hi! You can do it with ANSI escape codes:

print("\033[1mbold text\033[0m normal text") print("\033[31mred text\033[93m yellow text\033[0m normal text")

Find more colors here

Profile icon
Leroy01010

thx i will try them

@Coder100