Python First Program
In this tutorial, we will develop the Python Hello, World program.
Here’s a simple “Hello, World!” program in Python:
1 |
print("Hello, World!") |
To run this program, follow these steps:
- Open a text editor (e.g., Notepad, Sublime Text, Visual Studio Code, etc.).
- Copy and paste the above code into the text editor.
- Save the file with a .py extension, for example, “hello_world.py”.
- Open your command-line interface (e.g., Command Prompt on Windows or Terminal on macOS/Linux).
- Navigate to the directory where you saved the “hello_world.py” file using the
cd
command (Change Directory). - Run the Python script using the
python
command followed by the script’s filename:
1 |
python hello_world.py |
You should see the output:
Hello, World!