-1
>>> x='\u20ac'
>>> x
'€'

Is there a way to print the string '\u20ac' directly instead of that euro sign? (on python)

Jolly
  • 7
  • 2

2 Answers2

-1

Yes! The \ actually means “The next character is not a normal character.” But adding a \ before that will say: “This next character IS a normal character! Because -*- = +. Just add an extra \ in front.

“\\u20ac”

  • 1
    It doesn't work. When I type x in console, it prints out '\\u20ac'. Do you have any other solutions? – Jolly May 03 '20 at 09:39
-1

You have to use double backslash.

x = '\\u20ac'

You're welcome.

xzy54
  • 80
  • 6