Hi @SunMesa
Welcome to Microsoft Q&A!
I successfully ran your code in Visual Studio 2017, whether it is four spaces or a Tab, it runs successfully.
for j in range(0,3):
print('j = ',j)
mylist = [ 11*j+i for i in range (0,11) ]
print(*mylist)
You can try to create a new project to run this code.
*
Update:
According to your statement, I read this document and tested it, and I found this result:
When you manually enter the code, it can run correctly regardless of whether the code contains an unpack operator, but when the code contains an unpack operator, copy and paste the code and then run it will cause an error. Obviously, the Python Interactive window treats the line where the unpack operator is located as the beginning of new code.
I think this is a bug. I suggest you can start a new thread and report this issue to VS Product Team in our Developer Community with some reproduced or detailed information. if you do report this issue, please share the link here, other forum members who are interested or meet the same or similar issue can go to vote for this thread.
Sincerely,
Peng
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread