+ 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?

15th Sep 2021, 3:36 AM
Harsha S
Harsha S - avatar
6 Réponses
+ 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("-----")
15th Sep 2021, 3:52 AM
abhinav
abhinav - avatar
+ 2
This is because you are importing Colorama module , it won't work in sololearn, I tried too in past
15th Sep 2021, 3:40 AM
<★Shaurya Chauhan★>
<★Shaurya Chauhan★> - avatar
+ 2
Some compilers may have colored text because they have colorama module downloaded in them automatically or you may have downloaded it
15th Sep 2021, 3:41 AM
<★Shaurya Chauhan★>
<★Shaurya Chauhan★> - avatar
+ 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!
15th Sep 2021, 4:37 AM
abhinav
abhinav - avatar
+ 1
Calvin Thomas exactly.
15th Sep 2021, 6:07 AM
abhinav
abhinav - avatar
15th Sep 2021, 3:38 AM
Harsha S
Harsha S - avatar