Heyo
I'm learning Python and I came across this example:
''.join(str(e) for e in blank)
which returns:
'sadfsdfsd_ _ _ _ _ _ _ _ '
I read this and that example makes sense
So the code str(e) for e in blank
is the sequence that is passed to the join
method. But why doesn't it run independently?
str(e) for e in blank
File "<stdin>", line 1
str(e) for e in blank
^
SyntaxError: invalid syntax
blank btw is = ['text', '_ ', '_ ', '_ ', '_ ', '_ ', '_ ', '_ ', '_ ']