【问题标题】:Why can't I print outside loop [duplicate]为什么我不能在循环外打印[重复] 【发布时间】:2016-11-07 08:33:54 【问题描述】: I am a code beginner.Can anyone tell me what happend if I get a syntaxerror when putting the "print" outside the loop 【问题讨论】: 欢迎来到 Stack Overflow。请收下tour 并阅读How to Ask。 标签: python loops printing 【解决方案1】: 似乎您正在使用交互式解释器外壳。在尝试打印之前,您应该在循环的最后一行之后按 enter。 在以后的问题中,请在问题正文中写下您的代码,而不是附上屏幕截图。 【讨论】: