How to print out a variable's value in another colour?
Hi guys, so this question is kind of related to the other question that I asked: https://www.sololearn.com/discuss/1603568/?ref=app I mucked around for a while, and I came up with another question: Is there a way to print out a variable on screen in a different color? Let's say I have: [BEG] name = 'Booey' [END] Running: [BEG] print(name) [END] will obviously return: [BEG] Booey [END] But how do I print it out in a different color? I tried: [BEG] print(\033[32mname) [END] And I got: [BEG] >>> print(\033[32mname) File "<stdin>", line 1 print(\033[32mname) ^ SyntaxError: unexpected character after line continuation character [END] Then I tried: [BEG] print('\033[32mname'] [END] and got the output: [BEG] name [END] ... printed in green I want to print out: "my name is Booey", using the variable "name" instead of the string "Booey", and have it printed in another colour. Anyone?