ASCII Code Conversion Table

  • Share this:

Code introduction


Converts a string into a dictionary of ASCII code values.


Technology Stack : No packages

Code Type : Function

Code Difficulty : Beginner


                
                    
def ascii_table(text):
    """
    Convert a string into an ASCII table representation.
    """
    ascii_table = {}
    for char in text:
        if char not in ascii_table:
            ascii_table[char] = ord(char)
    return ascii_table                
              
Tags: