1.12. A Typical First Program


Traditionally, the first program written in a new language is called Hello, World! because all it does is display the words, Hello, World! In Python, the source code looks like this.

Nhìn chung, chương trình đầu tiên được viết bởi một ngôn ngữ được gọi là "Hello, World!" bởi vì tất cả nó chỉ là hiển thị lên màn hình chữ "Hello, World!" trong Python, mã nguồn lập trình cũng như vậy.


print("Hello, World!")
This is an example of using the print function, which doesn’t actually print anything on paper. It displays a value on the screen. In this case, the result is the phrase:
Đây là 1 ví dụ của việc sử dụng chức năng in, đây không phải là in bất kỳ cái gì lên giấy. Nó chỉ hiển thị 1 giá trị trên màn hình. Trong trường hợp này, kết quả là 1 cụm từ:
Hello, World!
Here is the example in activecode. Give it a try!
1
print("Hello, World!")
2
(ch01_2)
The quotation marks in the program mark the beginning and end of the value. They don’t appear in the result.
Dấu ngoặc trong chương trình đánh dấu đoạn bắt đầu và kết thúc của giá trị. Chúng không hiển thị trên kết quả.
Some people judge the quality of a programming language by the simplicity of the Hello, World! program. By this standard, Python does about as well as possible.
Một vài người đánh giá chất lượng của một chương trình bằng sự đơn giản của chương trình Hello, World!. Với tiêu chí này, Python có thể làm tốt.
Check your understanding


intro-12-1: The print function:




References:


http://interactivepython.org/runestone/static/thinkcspy/index.html

Nhận xét

Bài đăng phổ biến từ blog này

2.7. Operators and Operands - toán tử và toán hạng

1.11. Formal and Natural Languages