Sorry I encountered this in the book in Chapter 2:
One consequence of whitespace formatting is that it can be hard to copy and paste code
into the Python shell. For example, if you tried to paste the code:
for i in [1, 2, 3, 4, 5]:
notice the blank line
print i
into the ordinary Python shell, you would get a:
IndentationError: expected an indented block
because the interpreter thinks the blank line signals the end of the for loop’s block.
Sorry I encountered this in the book in Chapter 2:
into the ordinary Python shell, you would get a: IndentationError: expected an indented block because the interpreter thinks the blank line signals the end of the for loop’s block.
But it actually works in my Python Shell.
So I am confused whether it is right?