it's not an error.
In the first example you use
(a[x] for x in range(6))
is generator expression that returns iterator. when you pass it as argument to function like print() you can omit the brackets to same effect.In the first example you use
list()
to convert the same generator to a list
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