elif command == 'join':
if len(params) < 1: continue
safeexec(params[0], getattr(botimpl, 'onenter', None), (params[0], prefix))
Run Code Online (Sandbox Code Playgroud)
它说
语法错误“继续”在循环中不正确
当我运行文件时。
你不能continue从一个if声明。你需要它处于循环中。
for x in range(10):
if x == 4:
continue
# Do work
Run Code Online (Sandbox Code Playgroud)
然而,
if x == 4:
continue
Run Code Online (Sandbox Code Playgroud)
是错的。
Python 文档说明了这一点:
continue 语句也是从 C 中借来的,继续循环的下一次迭代: