摘要:
try: f = open('C:/Users/34810/Desktop/test.txt', 'r') print(f.read()) finally: if f: f.close() # 简略写法 with open('C:/Users/34810/Desktop/test.txt', enc 阅读全文
posted @ 2026-04-20 15:25
幻影之舞
阅读(4)
评论(0)
推荐(0)
摘要:
# 高阶函数map | reduce | filter | sorted # map(fn, List) def newList(x): return x * x list_c = map(newList, [1,2,3,4,5,6]) print(list(list_c)) # [1, 4, 9, 阅读全文
posted @ 2026-04-20 15:11
幻影之舞
阅读(5)
评论(0)
推荐(0)
摘要:
student = {'li': 17, 'zc': 15, 'se': 19, 'ww': 20} 普通遍只有key for item in student: print(item) # li zc se ww 值的遍历 val in Dict.values() for item in stude 阅读全文
posted @ 2026-04-20 11:14
幻影之舞
阅读(5)
评论(0)
推荐(0)

浙公网安备 33010602011771号