Your First Python Script

Let’s write and run your very first Python program.

1. Create a New File:

Open your IDE and create a new file named hello.py.

2. Add the following code:

print("Hello, world!")

3. Run the Script:

  • In VS Code: Right-click in the editor and choose Run Python File in Terminal.
  • In terminal: Navigate to the file's directory and run:
python hello.py

This will output:

Hello, world!

Congratulations! You just ran your first Python program.

← PrevNext →