UNQ_C8 not enough values to unpack (expected 2, got 0)

My issue

This is an analogy of what I am facing with in the last question.

for _ in range(1, 10):
    y = []
    if len(y) == 2:
        continue
    print('x')

`Output:
x
x
x
x
x
x
x
x
x

I thought continue was meant to break if the condition returns False but it kept going through. Can anyone enlighten me on this? I appreciate your help!

ps. I am also stuck at the last iteration of the for loop for backward_viterbi. So, if you could help me on that question as well I would be so grateful. :face_holding_back_tears:

len(y) seems here in this code never becomes 2 and continue does not break the loop, break does end the loop though!

1 Like

Sorry, let me rephrase that. I thought it meant to refer back to the for loop until the condition is met, and let the code in the latter run.

I implemented this method from the previous code block, where we compute the accuracy of the word-based pos tagging.

When you split the y, you will continue only if the split is not 2 words, otherwise if its 2 words precisely, the loop will progress further down.

Thank you for your help, and sorry for not nailing my point precisely. My issue was I misinterpreted the ifcontinue in human implication.

It actually means if…skip in human implication. Thank you so much for your help, @gent.spah !

1 Like