在Python中打印反斜杠,您需要使用转义字符`\`。以下是几种方法:
1. 使用双反斜杠:
print("C:\\Program Files\\Good\\")
2. 使用原始字符串(在字符串前加`r`):
print(r"C:\Program Files\Good\")
3. 使用字符串拼接:
print("C:\\" + "Program Files\\" + "Good\\")
4. 使用字符串格式化:
print("C:\\Program Files\\Good\\")