0

Printing degree symbol (°) doesn't work for me (using Python 3.7). I am using Windows 10, Sublime Text 3 and I use the following encoding on top of the file I am working with:

# -*- coding: utf8 -*-

It, however, works when built with Python 2.7.

An example:

temperature = str(26) + '°C'
print(temperature)

outputs 26�C in Python 3.7 and 26°C in Python 2.7.

Any ideas?

veinar90
  • 13
  • 2
  • 1
    When you attempt to use the same code directly in the python interpreter, does it yield the same result? – GetHacked Jul 22 '19 at 15:17
  • It actually works in the python interpreter. I changed the encoding to cp1252, and it works when I build with Sublime Text. – veinar90 Jul 22 '19 at 15:24
  • Good to hear. Make sure to submit that as an answer to your question - that's allowed and encouraged! – GetHacked Jul 22 '19 at 15:46

0 Answers0