# 位数与变量相等的连续赋值
a, b, c = 'qwe'
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
# 位数与变量不相等时连续赋值报错
a, b, c = 'qweqweqwe'
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
# 解包方法一:用下标赋值
s = 'qweqweqwe'
a, b, c = s[0], s[1], s[2:]
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
# 解包方法二:用*声明变量
s = 'qweqweqwe'
a, b, *c = s
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
a, *b, c = s
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
# 声明的变量数大于值的个数
a, b, c, *d = 'qwe'
print(f'a ==> {a}')
print(f'b ==> {b}')
print(f'c ==> {c}')
print(f'd ==> {d}')