Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to unpack in python

p = (4, 5)
x, y = p # x = 4, y = 5 

data = ['ACME', 50, 90.1, (2012, 12, 21)]
name, shares, price, date = data # name = ACME, shares = 50, price = 90.1, date = (2012, 12, 21)

say = "Big"
a, b, c = say # a = B, b = i, c = g
Source by builtin.com #
 
PREVIOUS NEXT
Tagged: #unpack #python
ADD COMMENT
Topic
Name
8+6 =