def — Easy Playground
Defines a new function or method
Python Playground
Output
Click "Run" to execute your codedef 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?