【发布时间】:2019-08-24 14:43:48
【问题描述】:
vscode IDE 在 python 语言中使用 { print(i,end=' ') } 时显示错误
我用过pycharm IDE,它工作正常...
def showDivisor(number):
for i in range(1, number+1):
if number % i == 0:
print(i, end=' ')
showDivisor(24)
【问题讨论】:
-
你在 Python 2 上运行。
-
我用的是python 3,你可以在附图的第一行终端输出中看到
-
该行中没有任何内容表示特定的 Python 版本。另一方面,语法错误对于在 Python 2 上使用 Python 3
print()函数运行代码很典型。
标签: python printing visual-studio-code