Dec  = Decimal Value

Char = Character

'5' has the int value 53

if we write '5' - '0'  it evaluates to 53 - 48, or the int 5

if we write char c = 'B' + 32;  then c stores 'b'

 

ASCII Table :

Sample Examples :


print(ord('a')) 

print(ord('A')) 

print(ord('1')) 

print(ord('@')) 


Outputs :

97

65

49

64

 

Source - https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html