Displaying the Degree Symbol in Python -


i've got following code displays degree symbol , works fine python3 in pycharm:

print(u'\u00b0'+ " f") 

but when move code on python3 on pi following error:

print(u'\u00b0'+ " f")               ^ syntaxerror: invalid syntax 

does have idea on why happens , how fix it?

in python versions 3.0 through 3.2, u prefix on string literal not allowed. python 3.3 reintroduced aid in writing code works in both python 2 , python 3 (see pep 414).

i suspect code failing in 1 of older versions of python 3, , working on other system in newer version. in version of python 3, u unnecessary. can write '\u00b0'+ " f" or '\u00b0 f' instead.


Comments