The Offender Engine Book

Learn to program — Lua & Python, right here

1. Say hello 2. Variables 3. Loops 4. Functions

Functions

A function is a recipe with a name: define it once, use it whenever. Both languages read almost like the sentence you would say aloud — to greet somebody, print hello and their name.

Task: finish the greet function so the program prints hello, ada and then hello, alan, each on its own line.

goal output: hello, ada hello, alan