Chào các bạn,
Mình là dân ngoại đạo, mới tập lập trình Python (mình dùng bản 3.5) , đang học qua quyển Learn Python The Hard Way, tới bài tập số 13 thì mình gặp lỗi và không làm tiếp được.
Câu lệnh đây:
from sys import argv
script , first, second, third = argv
print (" the name of the script is:", script)
print ("the first variable is:", first)
print ("the second variable is:", second)
print ("the third variable is:", third)
Kết quả trả về là:
from sys import argv
script , first, second, third = argv
print (" the name of 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 "<ipython-input-1-d64392378067>", line 3, in <module>
script , first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 3)
Mình đã cố gắng đọc trên mạng, các trang tiếng Anh nhưng vẫn không thấy cách giải quyết.
Thật sự mình đang khá là lo, mong được sự gúp đỡ của các tiền bối đi trước.
Cảm ơn