更新 260421-2509165039.py

This commit is contained in:
2026-04-21 23:42:28 +08:00
parent 927cfa6230
commit 53f0bad1c6

View File

@@ -4,7 +4,7 @@ text = "Hello"
for char in text:
print(f"'{char}'的ASCII码是:{ord(char)}")
# 2.用 chr() 函数验证字符65对应的是大写字母A
# 2.用chr()函数验证:字符65对应的是大写字母A
char_65 = chr(65)
print(f"ASCII码65对应的字符是:{char_65}")
print(f"验证结果:{char_65 == 'A'}")