序列类型:字符串,列表,元祖
a = "电脑", "手机" print("值为:{} ,类型为:{}".format(a, type(a))) # 结果:值为:(‘电脑‘, ‘手机‘) ,类型为:<class ‘tuple‘>
a = "电脑", "手机" b1, b2 = a print("c1=", b1) print("c2=", b2) # 结果: # c1= 电脑 # c2= 手机
字符串拆包操作
b = "12345" str1, str2, str3, str4, str5 = b print(str1, str2, str3, str4, str5) # 结果:1 2 3 4 5
*******请大家尊重原创,如要转载,请注明出处:转载自:https://www.cnblogs.com/shouhu/,谢谢!!*******
原文:https://www.cnblogs.com/shouhu/p/12739822.html