9.3 Interactive input 9.4 Expression input Chapter 9. Top-level components 106 The Python Language Reference, Release 3.9.5 Input in interactive mode is parsed using the following grammar: $_{interactive_input}$::= [ stmt_list ] NEWLINE | compound_stmt NEWLINE Note that a (top-level) compound statement must be followed by a blank line in interactive mode; this is needed to help the parser detect the end of the input. $_{eval_input}$::= expression_list NEWLINE* eval() is used for expression input. It ignores leading whitespace. The string argument to eval() must have the following form: