Run Your First Python Program
Lesson 1 of 48 in Coddy's Python for GDScript Developers course.
You already know GDScript conditions, loops, Arrays, Dictionaries, functions, and script classes. Run the supplied Python statement in main.py. Python executes module-level statements without _ready, _init, or a SceneTree. The locked driver.py starts your editable module. This course teaches Python from its first run, checking the semantic differences behind familiar indentation. No previous Python knowledge is needed.
Challenge
BeginnerRun 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 GDScript Developers
1From GDScript to Python
Run Your First Python ProgramPrint Is Not printsVar, Const, and BindingsInteger Division DifferencesSimilar Indentation, New ScopeRecap: Rewrite a Receipt4Iteration and Transformations
Ranges and RebindingItems and enumerateWhile and Early ExitArray Callbacks and KeysRecap: Build a Ranking2Values and Decisions
Null and NoneThe is Keyword Changes MeaningLogical Results and OperandsConditional ExpressionsRecap: Eligibility Rules3Collections and Shared State
Array and List APIsArrays, Vectors, and TuplesDictionary Lookup RulesDuplicate and Shallow CopyRecap: Clean an Inventory6Input, Errors, and Modules
Console Work Outside GodotValidation and ExceptionsScript Resources and ImportsTyped GDScript and AnnotationsRecap: Validate a Batch9Project: Order Processing
Create the Order ModelAdd Pricing PoliciesPractice on your own: Online Python compiler