Good. You could see that the text
Hello, World! appeared in our console output. We used the following code for that:
Let's analyze what happened:
print() is a function. Functions are reusable fragments of code with unique names and pairs of parentheses. Inside the parentheses, we provide arguments. If you know Excel, you can probably recognize this syntax.
print() is used to show text in the console output. Whatever is put inside the parentheses will be displayed to the user.
'Hello, World!' is a string. In the world of programming, strings are text values. In Python, strings must be surrounded with either single quotation marks (
'Hello, World!') or double quotation marks (
"Hello, World!"). Best practice is to always use single quotation marks. The quotes are never printed to the user – they only denote the start and end of a string.