Previous Up Next

5.4.7  ASCII code of a character: ord

ord takes as argument a string s (resp. a list l of strings).
ord returns the ASCII code of the first character of s (resp. the list of the ASCII codes of the first character of the elements of l).
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]

Previous Up Next