Writing your first Python program

Here is an example of a simple “Hello, World!” program written in Python:

1. Open a text editor such as Notepad or Sublime Text.

2. Type the following code into the editor:

python
print("Hello, World!")

3. Save the file with a name like “hello.py”. The “.py” extension tells the operating system that this file contains Python code.

4. Open a command prompt or terminal and navigate to the directory where you saved the “hello.py” file.

5. Type the following command to run the program:

bash
python hello.py

6. The output should be:

bash
Hello, World!

Congratulations! You have just written and executed your first Python program.

In this program, the `print()` function is used to output the text “Hello, World!” to the console. The `print()` function can be used to output text, numbers, and variables to the console.