print(item, sep=' ')
- you pass just one object as first argument to print function, a tuple with n elements. It prints a tuple (i.e. incl brackets and elements separated by comma - that is str representation of a tuple). In this case sep
does not come into play - there is one argument.print(*item, sep=' ')
- note the asterisks. This is iterable unpacking. you unpack the iterable (i.e. the tuple). print function gets n positional elements, not single tuple. Then sep
comes into play and you get the output you expect.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs