Python: Allowed Characters in Identifiers
Unicode Characters in Variable and Function Names
- Python 3 allows Unicode Letter Character in variable and function names.
- Math symbols such as ⊕ ° are not allowed.
def φ(n): return n + 1 α = 4 print(φ(α)) # 5
import math deg = math.pi / 180; print( 90 * deg) # 1.5707963267948966 # U+B0: DEGREE SIGN ° = math.pi / 180; # ° = math.pi / 180; # ^ # SyntaxError: invalid character '°' (U+00B0)