Pages

Subscribe:

Ads 468x60px

Wednesday, December 7, 2022

How to unpack a collection of data into variables

 If we have a collection of data in a list and we want to assign it to a set of variables we can do this in python, this concept is called unpacking.

See the bellow code:

fruits = ["web""healer""blog"]
x, y, z = fruits
print(x)
print(y)
print(z)


No comments:

Post a Comment