Skip to content

Commit 76da1b8

Browse files
committed
Skipping lines: Update explanation
* Add more accurate explanation * Add more relevant example Closes satwikkansal#39
1 parent 2ade33d commit 76da1b8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,24 @@ Wut?
172172
173173
#### 💡 Explanation
174174
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.
176176
177177
```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
180187
>>> value
181188
42
182189
```
183190
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.
192+
184193
---
185194
186195
### Well, something is fishy...

0 commit comments

Comments
 (0)