Ask Your Question

Revision history [back]

The problem comes from how you called your function. The function returns an empty list, but you try to assign two variables with that output.

A simpler example:

sage: def my_empty_func():
sage:     return []
sage: a,b = my_empty_func()
...
ValueError: need more than 0 values to unpack

Here, the error means that you need the function my_empty_func() to return a list (or tuple) of two elements, but it returned a list of zero elements.

The problem comes from how you called your function. The function returns an empty list, but you try to assign two variables with that output.

A simpler example:

sage: def my_empty_func():
sage:     return []
sage: a,b = my_empty_func()
...
ValueError: need more than 0 values to unpack

Here, the error means that you need the function my_empty_func() to return a list (or tuple) of two elements, elements to feed a and b, but it returned a list of zero elements.

The problem comes from how you called your function. The function returns an empty list, but you try to assign two variables (fname and cname) with that output.

A simpler example:

sage: def my_empty_func():
sage:     return []
sage: a,b = my_empty_func()
...
ValueError: need more than 0 values to unpack

Here, the error means that you need the function my_empty_func() to return a list (or tuple) of two elements to feed a and b, but it returned a list of zero elements.