上一页 1 ··· 5 6 7 8 9
摘要: import os folder_path = (r'D:\Programs\Python\Python37' ) fn = [filename for filename in os.listdir(folder_path) if filename.endswith(('.exe', '.py')) 阅读全文
posted @ 2024-10-27 23:02 世梦 阅读(20) 评论(0) 推荐(0)
摘要: a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] d = [c for b in a for c in b] print(d) print(3029) 阅读全文
posted @ 2024-10-27 23:00 世梦 阅读(39) 评论(0) 推荐(0)
摘要: L = ['abc', 12, 3.45, 'python', 2.789] print(L) print(L[0]) L[0] = 'a' L[1:3] = ['b', 'Hello'] print(L) L[2:4] = [] print(L) print(3029) 阅读全文
posted @ 2024-10-27 22:57 世梦 阅读(13) 评论(0) 推荐(0)
摘要: import numpy as np a = [] with open('data2.txt', 'r', encoding='utf-8') as f: for i, s in enumerate(f): counts = (s.count('a'), s.count('c'), s.count( 阅读全文
posted @ 2024-10-27 22:55 世梦 阅读(9) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9