Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 3
Someone to explain to me the ord() function in Python
How the ord() is used to convert a character to its Unicode value
4 Answers
+ 3
The code is here
```print(ord('a'))
print(ord('0'))```
+ 3
The ord() function will give you the ascii code or unicode point of a character. it is an integer number.
ord('a') -> 97
ord('1') -> 49
+ 1
ord() returns ASCII of an character. ord(a) returns 97.
You can find ASCII tables online, here is one of them: https://images.app.goo.gl/gJ6mygY2gegBtBsz7
+ 1
Meaning all characters have their unique value