ord()
Mon Jan 31 2022 05:32:48 GMT+0000 (Coordinated Universal Time)
Saved by
@marcpio
# built-in function ord converts character to numeric code
# chr converts numeric codes to characters
# letters of the alphabet are encoded in alphabetical order
ord('c') - ord('1')
>> 2
# NOTE: numeric codes for uppercase letters are different
content_copyCOPY
Comments