Someone to explain to me the ord() function in Python | SoloLearn: Learn to code for FREE!

+2

Someone to explain to me the ord() function in Python

How the ord() is used to convert a character to its Unicode value

5/15/2020 2:19:47 PM

Tosh

4 Answers

New Answer

+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