Menu
CoddyTech

Run Your First Python Program

Lesson 1 of 48 in Coddy's Python for PHP Developers course.

You already know PHP variables, arrays, functions, and basic classes. This course starts Python from its first run, then compares the rules that make direct PHP ports fail. Run the supplied program in main.py. Python needs no <?php tag, and print adds a newline. The locked driver.py starts the editable module. Later lessons explain imports, shared objects, and class methods. No earlier Python course is required.

challenge icon

Challenge

Beginner

Run the supplied program once. There is no input. It prints Python is ready followed by a newline. No edits are needed.

Your code goes in main.py. The locked driver.py starts your program and cannot be edited.

Try it yourself

# Starts the program in main.py. Edit main.py to solve the challenge.
from runpy import run_module

run_module("main", run_name="__main__")

All lessons in Python for PHP Developers

Practice on your own: Online Python compiler