主要是字符类型数据的解码和编码问题,在解释器下运行见下图:
str1=b'china' str2=0o1000 str3='我爱北京天安门' string_demo=str1.decode() print(string_demo) bytes_demo=string_demo.encode() print(bytes_demo) print(str2) print(str3)
运行结果:
图片都不清楚哦