← Courses

Python for AI — Beginner Foundations

Data Science

Getting Started · Lesson 11 of 76

First Python file

On your own machine, a Python program is just a text file ending in .py. Create one called hello.py with a single line:

print("Hello from my first program!")

Then run it from the terminal, in the same folder:

python hello.py

It prints the message and exits. That's the whole loop: write a .py file → run it → read the output. Right here in the browser, the Run box does the same thing for you:

Python

Your turn: add a second line that prints your goal for learning Python.

You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →