"ord" module to get ascii values of a character

Home Forums Python Programming "ord" module to get ascii values of a character

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2055 Reply
    Humble
    Keymaster
    ord(...)
        ord(c) -> integer
        
        Return the integer ordinal of a one-character string.
    
    
    
    
    Its clear from topic title and above snip that, ord function can be used to return ascii value of a character.
    
    For ex:
    
    
    >>> ord('0')
    48
    
    >>> ord('A')
    65
    
    >>> ord(' ')
    32
    >>> 
    
    >>> ord('\n')
    10
    >>> 
    
    >>> ord('a')
    97
    >>> ord('9')
    57
    >>> 
    
Viewing 1 post (of 1 total)
Reply To: "ord" module to get ascii values of a character
Your information: