nếu có điều gì đang xảy ra sai, bạn luôn có thể cố gắng kêu gọi sự giúp đỡ:
>>> help(print)
Help on built-in function print in module builtins:
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout)
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.
và ở đó bạn có thể thấy, tha cú pháp đó print
điều print(something)
hài hước là, rằng trong python 2, bạn sẽ có được chỉ là một thông báo lỗi:
>>> help(print)
SyntaxError: invalid syntax
đó là vì trong python < 3, print
chức năng không phải là một hàm, mà là một từ khóa (giống như ví dụ: for
hoặc or
)
Xem [ lỗi cú pháp python trên in ] (http://stackoverflow.com/questions/826948/python-syntax-error-on-print). –
Cài đặt Python 2.7 (hoặc đọc tài liệu) –