You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-3
Original file line number
Diff line number
Diff line change
@@ -172,15 +172,24 @@ Wut?
172
172
173
173
#### 💡 Explanation
174
174
175
-
Some Unicode characters look identical to ASCII ones, but are considered distinct by the interpreter.
175
+
Some non-Western characters look identical to letters in the English alphabet, but are considered distinct by the interpreter.
176
176
177
177
```py
178
-
>>>value=42#ascii e
179
-
>>> valuе =23#cyrillic e, Python 2.x interpreter would raise a `SyntaxError` here
178
+
>>>ord('е') # cyrillic 'e' (Ye)
179
+
1077
180
+
>>>ord('e') # latin 'e', as used in English and typed using standard keyboard
181
+
101
182
+
>>>'е'=='e'
183
+
False
184
+
185
+
>>>value=42# latin e
186
+
>>> valuе =23# cyrillic 'e', Python 2.x interpreter would raise a `SyntaxError` here
180
187
>>> value
181
188
42
182
189
```
183
190
191
+
The built-in`ord()` function returns a character's Unicode [code point](https://en.wikipedia.org/wiki/Code_point), and different code positions of cyrillic 'e' and latin 'e' justify the behavior of the above example.
0 commit comments