使用map()进行多个输入会显示语法错误

问题描述 投票:0回答:1
n=list(map(int, input().split()))
print(n)

我正在将sublime text3与python3构建系统一起使用。在REPL窗口中运行代码,提供输入后,将产生如下错误。This error is what I get after hitting enter

python input sublimetext3
1个回答
0
投票

似乎您正在使用某些Python 2,其中提供给input()的字符串被评估为python表达式。

如果需要的话,请确保使用的是Python 3解释器。(或改用raw_input。)>

© www.soinside.com 2019 - 2024. All rights reserved.