### 5.2.8ASCII code of a character

The ord command finds the ASCII code of a character.

- ord takes str, a string (or a list of strings). ord(str) returns the ASCII code of the first character of str (or the list of the ASCII codes of the first characters of the elements of the list str).

#### Example

ord("a")

97 |  |  |  |  |  |  |  |  |  |

ord("abcd")

97 |  |  |  |  |  |  |  |  |  |

ord(["abcd","cde"])

| ⎡ ⎣ | 97,99 | ⎤ ⎦

ord(["a","b","c","d"])

| ⎡ ⎣ | 97,98,99,100 | ⎤ ⎦