I have just started to learn Python and i bought the book 'Learn Python 3 the Hard Way'. Well every thing was fine until i came to exercise 13 and it was called Parameters, Unpacking, Variables. All i had to do was copy the following:
But no matter what or how many times i've checked and re-checked i always get
an error message when i run it. The error message is as follows:
$ oldDog@-linux-desktop:~$ python3.6 ~/python_scripts/ex13.py
File "/home/oldDog/python_scripts/ex13.py", line 3, in <module>
script, first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 1)
$ oldDog@-linux-desktop:~$
Could someone please show me what i've done wrong.
Big thanks
from sys import argv script, first, second, third = argv print("The script is called:", script) print("The first variable is:", first) print("The second variable is:", second) print("The third variable is:", third)Save it as ex13.py and then run it. I used the Atom text editor.
But no matter what or how many times i've checked and re-checked i always get
an error message when i run it. The error message is as follows:
$ oldDog@-linux-desktop:~$ python3.6 ~/python_scripts/ex13.py
File "/home/oldDog/python_scripts/ex13.py", line 3, in <module>
script, first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 1)
$ oldDog@-linux-desktop:~$
Could someone please show me what i've done wrong.
Big thanks