1.遍历列表提取下标和值:
for index,value in enumerate(['apple', 'oppo', 'vivo']):
print(index,value)
2.bytes 和 str 的互相转换
字符串转bytes:str.encode('utf-8')
bytes转字符串:bytes.decode('utf-8')
1.遍历列表提取下标和值:
for index,value in enumerate(['apple', 'oppo', 'vivo']):
print(index,value)
2.bytes 和 str 的互相转换
字符串转bytes:str.encode('utf-8')
bytes转字符串:bytes.decode('utf-8')