-3

我正在编写一个来自 Zed A. Shaw 的“Learn Python the Hard Way - 第三版”的程序。我是编程新手,完全卡在练习 12 上。请查看我的代码并帮助我解决我做错的地方,因为我所知道的正是它应该在书中看到的

from sys import argv

script, first, second, third = argv

print "The script is called:", script
print "Your first variable is called:", first
print "Your second variable is:", second
print "Your third variable is:", third

完整的错误信息如下(由于经验不足,我很难理解)

Traceback (most recent call last):
  File "ex13.py", line 3, in <module>
    script, first, second, third = argv
ValueError: need more than 1 value to unpack
4

1 回答 1

-1

So probably you were using more args than actually passing the same lengthed args 1

Here is the execution if you pass less than actually using them in the script.2

Please Find Attachments.

于 2019-05-18T21:01:20.397 回答