Answers for "ord python3"

19

ord python

# The ord() function returns an integer representing the Unicode character.
res = ord('A')
print(res)
# output 65
Posted by: Guest on March-28-2020
0

ord python3

# ord('a') means 'get unicode of a'
ord('a') = 97

# chr(97) is the reverse, and means 'get ascii of 97'
chr(97) = 'a'

# to get the int val of a single digit represented as a char, do the following:
# ord(single_digit_char) - ord('0') = single_digit_int
ord('5') - ord('0') = 5
ord('3') - ord('0') = 3
Posted by: Guest on June-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language