You can download this code by clicking the button below.
This code is now available for download.
This function takes a string as input and outputs each character along with its ASCII code.
Technology Stack : String manipulation
Code Type : Function
Code Difficulty : Intermediate
def ascii_table(text):
"""
将字符串转换为ASCII字符画表
"""
ascii_art = ""
for char in text:
ascii_art += f"{ord(char)}: {char} "
return ascii_art