Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

how to add colour

Leroy01010
Leroy01010

how can you add colour to a text in python

2 years ago
Answered by Bookie0View Answer

Voters

Comments

TopNew
3
Bookie0
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! =)

2 years ago
1
Leroy01010
Leroy01010

thanks much easier

@Bookie0

2 years ago
1
Coder100
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

2 years ago
Load more