我试图在四行中打印 8,当我在中间使用新行时出现错误。
>>> print(add, sub, mul,"\n"devide)
File "<stdin>", line 1
print(add, sub, mul,"\n"devide)
^
SyntaxError: invalid syntax
>>> print(add, sub, mul, devide)
8 8 8 8
>>>
你应该尝试这个:
print(add, "\n", sub, "\n", mul, "\n", devide)
这将在新行中打印所有四个 8。