list1=['a','b','c','d','e','f','g','h']
def detail(i):
global z,l
z=i,l=''
for j in list1[z:]:
if j!='g':
l=l+j
else:
break
return l
print(detail(1))
报错:
Traceback (most recent call last):
File "c:/Users/lenovo/Desktop/函数试.py", line 12, in <module>
print(detail(1))
File "c:/Users/lenovo/Desktop/函数试.py", line 4, in detail
z=i,l=''
ValueError: not enough values to unpack (expected 2, got 0)