摘要:
# 真假 copy # 假copy names = ['Tudou', 'Qiezi',['Xiaocong', 'Lajiao'], 'Xihongshi', 'Baicai', 'Qingcai'] name1 = names.copy() # 将names 复制到name1 names[0] = 'Fanqie' # 更改names中的值 print(names) pri... 阅读全文
摘要:
1 # python3中的 str 和 byte(即二进制)转换 2 msg = "β" 3 # 转换为二进制,打印,‘encoding = 'utf-8'为值定转换原str的编码格式’ 4 print(msg.encode(encoding='utf-8')) 5 # 由二进制转回str编码 6 print(msg.encode(encoding='utf-8').decode(... 阅读全文