defEasy Playground

Defines a new function or method

Python Playground
Output
Click "Run" to execute your code

def creates a named function. The return statement sends a value back to the caller.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?