题目一code:import string word_count 0 with open(article.txt, r, encodingutf-8) as f: content f.read() for char in string.punctuation: content content.replace(char, ) words_list content.split() for word in words_list: if word.isalpha(): word_count 1 with open(result.txt, w, encodingutf-8) as f: f.write(f英文单词总数量{word_count}) print(f统计完成单词总数{word_count})result:题目二code:with open(record.log,a,encodingutf-8) as f: f.write(2026‑07‑27 操作完成; \n) with open(record.log,r,encodingutf-8) as f: content f.read() print(content)result:题目三code:import math def calc_area(r): return math.pi*r**2 def calc_circum(r): return 2*math.pi*rimport math_tool r5 area1 math_tool.calc_area(r) circum1 math_tool.calc_circum(r) print(方式1 import math_tool) print(f半径{r}面积{area1:.2f}) print(f半径{r}周长{circum1:.2f}) # 方式2from 模块 import 函数 from math_tool import calc_area, calc_circum print(\n方式2 from导入) r2 6 area2 calc_area(r2) circum2 calc_circum(r2) print(f半径{r2}面积{area2:.2f}) print(f半径{r2}周长{circum2:.2f})result:题目四codeimport os filesos.listdir(.) import os for name in files: if name.endswith(.txt): print(txt文件, name) folder_name backup if not os.path.exists(folder_name): os.mkdir(folder_name) print(f文件夹 {folder_name} 创建成功) else: print(f文件夹 {folder_name} 已存在)result题目五codeimport os def scan_dir(path): for name in os.listdir(path): full_path os.path.join(path, name) if os.path.isdir(full_path): scan_dir(full_path) else: print(full_path) scan_dir(.) #.代表当前路径result: