ord python3

Solutions on MaxInterview for ord python3 by the best coders in the world

showing results for - "ord python3"
Jaden
28 May 2016
1# ord('a') means 'get unicode of a'
2ord('a') = 97
3
4# chr(97) is the reverse, and means 'get ascii of 97'
5chr(97) = 'a'
6
7# to get the int val of a single digit represented as a char, do the following:
8# ord(single_digit_char) - ord('0') = single_digit_int
9ord('5') - ord('0') = 5
10ord('3') - ord('0') = 3
11