From Python REPL
>>> # After this console
... # dotdotdot refers to the block of a function or specific syntax.
Therefore, ...
must be followed by proper grammar written on the block.
However, a print("a") without an indent has arrived, so a syntax error occurs.
It's the same for REPL in other languages The role of REPL is to receive a single command and immediately output a return value or log message.
To see the multi-line code working at once, as you intended, You have to fill it out as a file and run it.
© 2024 OneMinuteCode. All rights reserved.