Tuple packing:
====================================
t=(10,20,30,40)
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)
output:
a= 10 b= 20 c= 30 d= 40
Tuple packing for strings:
==============================
t="abcd"
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)
output:
a= a b= b c= c d= d
====================================
t=(10,20,30,40)
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)
output:
a= 10 b= 20 c= 30 d= 40
Tuple packing for strings:
==============================
t="abcd"
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)
output:
a= a b= b c= c d= d
No comments:
Post a Comment