How do I unpack the contents of an iterable into separate variables?
- unpacking
- assignment
OP has (200,300)
, wants x = 200; y = 300
.
tup = ('200', '300')
first, second = tup
first_int, second_int = map(int, tup)
How do I unpack the contents of an iterable into separate variables?
OP has (200,300)
, wants x = 200; y = 300
.
tup = ('200', '300')
first, second = tup
first_int, second_int = map(int, tup)