Python Unpacking List to Variable

July 25, 2019
items = [1, 2, 3]
num1, num2, num3 = items
items = [[1, 2], [3, 4], [8, 1]]
for num1, num2 in items:
    print(num1, num2)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.