I've got a simple python question. First, see the code.
l1 = ['one', ['1', '2']]
for item1, item2 in l1:
print (item1)
for subitem in item2:
print (subitem)
I assumed that this would print 'one' then '1' '2', but I receive the error:
for item1, item2 in l1:
ValueError: too many values to unpack (expected 2)
There's some code in the tutorial that I'm following (https://automatetheboringstuff.com/chapter9/) that leads me to believe that what I'm trying to do (the multiple args with the in statement) is possible - but what is the logic here?
item1, item2 = "one"so you get error