+ 3
where does this work?
https://code.sololearn.com/c13n0vOH1pex/?ref=app This code outputs normal text in some compilers and colored text in some. I got colored text output in command prompt in windows. Does anybody where all can I get colored text as output?
6 ответов
+ 4
Harsha S 
Colours would only show up in prompt and SoloLearn doesn't display the prompt but the text printed on it.
You can print colours without importing also.
print("-----")
print('\u001b[30mHello')	#black
print('\u001b[31mHello')	#red
print('\u001b[32mHello')	#green
print('\u001b[33mHello')	#yellow
print('\u001b[34mHello')	#blue
print('\u001b[35mHello')	#magenta
print('\u001b[36mHello')	#cyan
print('\u001b[37mHello')	#white
print('\u001b[1mHello')	   #bold
print('\u001b[4mHello')	   #underline
print('\u001b[0mHello')	 	#reset
print("-----")
+ 2
This is because you are importing Colorama module , it won't work in sololearn,  I tried too in past
+ 2
Some compilers may have colored text because they have colorama module downloaded in them automatically or you may have downloaded it
+ 1
<★Shaurya Chauhan★>(Darkness Is everywhere) I don't think so.. you can see that the import was successfull still the colors didn't show up!
+ 1
Calvin Thomas exactly.
0



