Files
task-3-2-1-Text-Processing-…/yzz.py
2026-04-21 11:29:52 +08:00

14 lines
431 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 方式1直接用字符串表示 "Hello"
str1 = "Hello"
# 方式2用单引号包裹表示 "Hello"
str2 = 'Hello'
print("方式1双引号", str1)
print("方式2单引号", str2)
print("\n--- Hello 每个字符的ASCII码 ---")
for char in "Hello":
print(f"字符 '{char}' 的ASCII码{ord(char)}")
print("\n--- chr() 函数验证 ---")
print(f"ASCII码 65 对应的字符:{chr(65)}")