← Python for Beginners

Lesson 3 of 3 · 9 min

Functions

Functions bundle code you can reuse: def greet(name): return "Hi " + name.

Arguments go in, a return value comes out — like a vending machine for logic.

Practice

Write a function that takes a score and returns "Pass" or "Fail".

Quiz

+50 pts
Meet your welcome bot

The club’s bot needs a reusable greeting function that accepts a name.

1. Build the Python function header.

Your formula or code
2. What sends a value out of a function?

Optional resources

Your lesson toolkit

No purchase or partner signup is required to complete this course or earn quiz points.

These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.

Replit

Try Python exercises in a browser coding workspace.

Free and paid plans; usage limits and feature availability vary.

Explore tool

DataCamp

Explore additional interactive Python practice.

Limited free content; full course access may require payment.

Explore tool