Get user input and save it up to three variables
2 answers
you cannot decompress into variables if the size changes. Well, not like that.
You can, using advanced iterative unpacking (also known as unpacking stars) (Python 3 only):
cmd, *args = input("> ").split(" ")
, , args , , .
if not args:
# there are no arguments
pass
elif len(args)>2:
print("too many args")
else:
print("args",args)
, split(" ") . split() ( : , ), shlex.split(input("> "))
: python 2 . , .
+7