摘要: import string # print(string.ascii_letters)#大小写 # print(string.ascii_lowercase) # print(string.ascii_uppercase) # print(string.digits) # print(string. 阅读全文
posted @ 2020-08-22 18:23 Mezhou 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 文件操作模式 : 只读模式 r f=open('a.txt','r',encoding='utf-8') 不写时默认是r模式。可读不可写。 只写模式 w f=open('a.txt','w',encoding='utf-8') 可写不可读,写时会将原始内容清空。 追加模式 a f=open('a.t 阅读全文
posted @ 2020-08-22 18:22 Mezhou 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 深拷贝: l = [0,1,2,2,3,4,5,6,7,8,9] # 0 1 2 3 4 5 6 7 8 9 10 import copy l2 = copy.deepcopy(l)#深拷贝,内存地址不一样 浅拷贝: l = [0,1,2,2,3,4,5,6,7,8,9] # 0 1 2 3 4 5 阅读全文
posted @ 2020-08-22 18:01 Mezhou 阅读(114) 评论(0) 推荐(0) 编辑