Dawn_Seeker @ 2020-01-11 21:37:12
为什么用题目里的这代码不对啊
s = input().split()
print(int(s[0]) + int(s[1]))
他跟我讲
>>> s = input().split()
print(int(s[0]) + int(s[1]))
SyntaxError: multiple statements found while compiling a single statement
举世皆清而我独浊,众人皆醒而我独醉……
by t162 @ 2020-01-11 21:38:34
您好,请一条一条输入,谢谢
by Dawn_Seeker @ 2020-01-11 21:43:48
@Bambusoideae 那么PYTHON是怎么打的呢?
by qwq自动机 @ 2020-01-11 21:56:28
xxx.py
文件xxx.py
中输入代码$> py xxx.py #Python2
或
$> py -3 xxx.py #Python3
by _maze @ 2020-01-11 22:01:31
兄弟,建议您买几本讲python语言部分的书研究一下
by Dawn_Seeker @ 2020-01-11 22:20:01
>>> s = input().split()
>>> print(int(s[0]) + int(s[1]))
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
print(int(s[0]) + int(s[1]))
IndexError: list index out of range
by Dawn_Seeker @ 2020-01-11 22:20:41
那么用Python3.7呢?
by DepletedPrism @ 2020-01-11 22:54:23
@许严中
>>> s = input().split()
1 2
>>> print(int(s[0]) + int(s[1]))
3
>>>
python3... 未能复现 (
by awa再也不水贴 @ 2020-01-11 23:33:54
@许严中 您不是对了吗?
by HoshiuZ @ 2020-01-12 11:17:48
@许严中 这位也是昨天才学的Python奆佬@lyser
by Dawn_Seeker @ 2020-01-13 21:33:28
@DepletedPrism oh,原来是边打程序边输入的,我还以为是和C++一样的呢。