Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

click to hide/show revision 2
No.2 Revision

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.

click to hide/show revision 3
No.3 Revision

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.