摘要:
a = [[1,2,3], [4,5,6], [7,8,9]] d = [c for b in a for c in b] print(d) 结果: D:\py\python.exe "D:\新建文件夹\python编译器\python 代码\ Python数学建模\数学建模例题\例题2.4.py" 阅读全文
摘要:
import numpy as np a = [] 使用原始字符串来避免转义问题 with open(r"D:\新建文件夹\python编译器\python 代码\wenjian\2.2.txt") as f: for line in f: # 你可以直接使用 for line in f 来迭代文件 阅读全文