Menu
CoddyTech

Run Your First Python Program

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

You already write C++ functions, loops, STL containers, and basic classes. This course introduces Python without requiring previous Python knowledge. Open main.py and run its supplied print statement. Unlike a C++ translation unit, Python can execute statements without an int main() wrapper. The provided driver.py runs your editable module. Later lessons explain imports and compare value semantics, resource lifetimes, and method calls.

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 C++ Developers

Practice on your own: Online Python compiler