【发布时间】:2016-08-18 01:46:14
【问题描述】:
这是我的程序
from sys import argv
script, first, second, third = argv
print ("the script is:", script)
print("the first variable is:", first)
print("the second variable is:", second)
print ("the third variable is:", third)
错误是:
Traceback (most recent call last):
File "C:/Users/ravikishore/PycharmProjects/Test/.idea/MyPython.py", line 2, in <module>
[script, first, second, third] = argv
ValueError: need more than 1 value to unpack
【问题讨论】:
-
我链接到的副本不仅与您遇到的问题相同,而且是同一教程中的相同练习。
-
顺便说一句,请注意许多 Python 程序员不推荐Learn Python the Hard Way。它有many problems,还有better free tutorials可供选择。如果您不想切换,至少要记住 还有 其他教程,所以如果 LPtHW 中的概念没有意义,您可以阅读其他解释,看看它们是否对你更有意义。
标签: python