Having difficulty adding another argument to Exercise 14.
Have tried various ways, but always get error.
Have a feeling I’m missing something simple…
1 from sys import argv
3 script, user_name, second = argv # I added ‘second’ as other argument
4 prompt = '> ’
lines 6 - 21 are same as code in book
Added following to add another argument to this script:
23 print(“What is your favorite app?”, second)
Get error message:
File “home/marks/…/ex14.py”, line 3 in
script, user_name, second = argv
Value error: not enough values to unpack (expected 3, got 1)
To run script in Terminal, I did:
$ python3 ex14.py Mark Excel
What am I doing wrong?
Thanks for your help.