| 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.
| 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.
| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.