how to colour letters in python

Solutions on MaxInterview for how to colour letters in python by the best coders in the world

showing results for - "how to colour letters in python"
Mathis
08 Aug 2019
1print("yourtext") #If you print anything, as default you'll get white text and black background
2print("\033[{effect};{textcolour};{textbackground}myourtext") #this won't actually work, you need to change the "{}" by a number
3"effect: 0 = none, 1 = bold, 2 = underline"
4"textcolour 30 = black, 31 = red, 32 = green, 33 = yellow, 34 = blue, 35 = purple, 36 = cyan, 37 = white."
5"textbackground = the same + 10
6
7"Example"
8print("\033[1;32;40m Bright Green  \n")