How can I add colors in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I add colors in python?

25th Dec 2022, 4:57 PM
Ghg8
Ghg8 - avatar
2 Answers
+ 2
pip install colorama import colorama print(colorama.Fore.RED + "This text will be red" + colorama.Fore.RESET) or print("\033[91mThis text will be red\033[0m")
25th Dec 2022, 5:01 PM
Lwez
Lwez - avatar
0
There is some ways: 1. Native: Terminal have codes for add colors, search it. Example: `\033[91m Text in red` 2. Colorama: This is a library that adds the codes with constants. Just install it on pip
26th Dec 2022, 10:54 AM
RinkaDeveloper
RinkaDeveloper - avatar