Core LogicFunctions & f-strings
All courses

Reusable blocks

Define with def, return with return. f"Hello, {name}" is an f-string — string formatting that actually feels modern.

Quirk #4 — Default args: Never use a mutable default like def bad(items=[]). That list is shared across all calls. Use items=None instead. This has destroyed many a Friday afternoon.

Try it

  • Add a parameter with a default value.
  • Call greet with and without excited=True.
Output
Press Run to execute your code.