From fe1a82759f65757d38d3bb6214b7c41ae2693ad1 Mon Sep 17 00:00:00 2001 From: "yinjun.chen1" Date: Tue, 1 Sep 2026 17:28:01 +0800 Subject: [PATCH] 000000 --- .vscode/settings.json | 14 ++++++++++++++ pythonProject/格式化字符串/format/5.py | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 pythonProject/格式化字符串/format/5.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9646212 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + // 在集成终端中运行,而不是"输出"面板 + "code-runner.runInTerminal": true, + // 使用命令提示符(PowerShell 5.1 不支持 && 连接符,会导致命令报错) + "terminal.integrated.defaultProfile.windows": "Command Prompt", + // 运行前先把控制台代码页切换为 UTF-8 (65001) + "code-runner.executorMap": { + "python": "chcp 65001 >nul && python -u" + }, + // 终端默认编码 + "terminal.integrated.env.windows": { + "PYTHONIOENCODING": "utf-8" + } +} diff --git a/pythonProject/格式化字符串/format/5.py b/pythonProject/格式化字符串/format/5.py new file mode 100644 index 0000000..9867d1c --- /dev/null +++ b/pythonProject/格式化字符串/format/5.py @@ -0,0 +1,9 @@ +dict = { + '小明':3.251, + '小李':3.569, + '小白':3.713, + '小花':3.416, + '小张':3.689 +} +for name,mark in dict.items(): + print(mark) \ No newline at end of file