Changing color when printing a string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Changing color when printing a string

does anyone know the code to add to change the color of printed strings while running a program

6th Dec 2017, 12:27 AM
David Aseltine
David Aseltine - avatar
8 Answers
+ 1
This was the code I tried and it gave the color to output https://code.sololearn.com/cHxza0a7XFq1/?ref=app
6th Dec 2017, 5:57 AM
#RahulVerma
#RahulVerma - avatar
+ 1
I saw your code and will be trying it out in the morning thank you I'll post on how it turns out
6th Dec 2017, 5:58 AM
David Aseltine
David Aseltine - avatar
0
I should add that I'm using python and basically I want to run something like this print ("hello world") and have it print out in red or green or blue
6th Dec 2017, 1:37 AM
David Aseltine
David Aseltine - avatar
0
couldn't get any of the examples to work but thank you
6th Dec 2017, 3:40 AM
David Aseltine
David Aseltine - avatar
0
It will not work in Code Playground of Sololearn Try it in python 3.6.2 shell
6th Dec 2017, 5:32 AM
#RahulVerma
#RahulVerma - avatar
0
that's what I tried it on could you possibly show me an example code to change print("this is red") to print in red? also do I need to download something it was hard to tell for sure from the article
6th Dec 2017, 5:33 AM
David Aseltine
David Aseltine - avatar
0
I did get this to run in the shell is there a way to do it in Wing IDE
6th Dec 2017, 4:49 PM
David Aseltine
David Aseltine - avatar