6.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:
Input:
ord("abcd")
Output:
Input:
ord(["abcd","cde"])
Output:
Input:
ord(["a","b","c","d"])
Output: