Reputation:
Here is a sample scenario -
>>> এক = 1
>>> ১ = 1
File "<stdin>", line 1
১ = 1
^
SyntaxError: invalid character in identifier
I'm running this from default python3
interpreter. Why do the first unicode string work as an identifier and not the second one?
Upvotes: 4
Views: 190
Reputation: 122456
Valid identifiers are explained in the Python 3 documentation: Lexical analysis - Identifiers and keywords.
The exact details can found in PEP 3131.
Upvotes: 2