# ASCII code of a character: ord

### 5.3.7 ASCII code of a character: ord

The ord command finds the ASCII code of a character.

- ord takes one argument:
  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.

Input:

ord("a")

Output:

97

Input:

ord("abcd")

Output:

97

Input:

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

Output:

⎡ ⎣ | 97,99 | ⎤ ⎦

Input:

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

Output:

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