根据书籍简明python教程查看到第一个例子为:print'hello world';
本人下载的为python3.6,在python自带的IDE里面进行编写,所以出现了一下报错:SyntaxError: invalid syntax
查看后,发现help('print')
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.
必须在print后面加上括号才可以正常输出。