Python获取字符ASCII码值
这是一个Python的实现:
char = input('请输入一个字符:')
ascii_code = ord(char)
print('该字符的ASCII码值为:', ascii_code)
首先使用 input() 函数获取用户输入的字符,然后使用 ord() 函数将字符转换为相应的 ASCII 码值,最后使用 print() 函数输出结果。
原文地址: https://www.cveoy.top/t/topic/oJQ6 著作权归作者所有。请勿转载和采集!