You can download this code by clicking the button below.
This code is now available for download.
The function accepts a string argument and returns a dictionary containing each character in the string and its corresponding ASCII value.
Technology Stack : Built-in function `ord()`, dictionary comprehension
Code Type : Function
Code Difficulty : Intermediate
def ascii_table(string):
ascii_values = {ord(char): char for char in string}
return ascii_values