Skip to content
Color Confusions
Profile icon
PattanAhmed

Hi,
See, This is my commands on a color string in Python.
As you all can see that I wrote print(Pink + "Hello") in First Line and print("Ok") in the second line.

But when I run this commands my second line string is also turning Pink even though I didn't mention Pink there...
Why is it happening?
Is there a solution to it?

Thanks,
Waiting for Replies!

You are viewing a single comment. View All
Profile icon
Bookie0

Hey, do this after the color imports:

END = '\033[0m'

Then to print the thing, do this:

print (Pink + “Hello” + END) print(“ok”)

The END should not make ok pink

Hope this helps!

Profile icon
PattanAhmed

@Bookie0
Thanks a lot, It worked fine
Just a small mistake you did is you have put " before Pink
Remove that, Then I will mark your answer as the correct answer!

Profile icon
Bookie0

Oh yeah whoops, typo. I made it correct now!
=)

@PattanAhmed

Profile icon
PattanAhmed

@Bookie0

I was needing that answer for so long.
Thanks a Lot

Profile icon
Bookie0

Yeah sure np thanks for selecting my answer! =)

@PattanAhmed

Profile icon
PattanAhmed

@Bookie0

Welcome

Profile icon
Bookie0
Profile icon
PattanAhmed