# 创建一个空的bytes值
b1 = bytes()
b2 = b''

# 通过b前缀指定hello是bytes类型的值
b3 = b'hello'
print(b3)
print(b3[0])
print(b3[2:4])

# 调用bytes方法将字符串转换为bytes对象
b4 = bytes('我爱Python编程', encoding='utf-8')
print(b4)

# 利用字符串的encode()方法编码成bytes，默认使用UTF-8字符集
b5 = "学习Python很有趣".encode('utf-8')
print(b5)


52d9030f3fe7ddb4e3882c7eaccfa78e3787f81f
<mask token>

<mask token>
print(b3)
print(b3[0])
print(b3[2:4])
<mask token>
print(b4)
<mask token>
print(b5)

b1 = bytes()
b2 = b''
b3 = b'hello'
print(b3)
print(b3[0])
print(b3[2:4])
b4 = bytes('我爱Python编程', encoding='utf-8')
print(b4)
b5 = '学习Python很有趣'.encode('utf-8')
print(b5)

# 创建一个空的bytes值
b1 = bytes()
b2 = b''

# 通过b前缀指定hello是bytes类型的值
b3 = b'hello'
print(b3)
print(b3[0])
print(b3[2:4])

# 调用bytes方法将字符串转换为bytes对象
b4 = bytes('我爱Python编程', encoding='utf-8')
print(b4)

# 利用字符串的encode()方法编码成bytes，默认使用UTF-8字符集
b5 = "学习Python很有趣".encode('utf-8')
print(b5)

