Here's an example of a Python function that calculates the average of two numbers, adds 3 to the result, and returns the final value:
main.py99 chars5 lines
To use this function, simply pass in two numbers as arguments:
main.py28 chars2 lines
This will output 7.0
, which is the average of 4 and 8 (which is 6) plus 3.
gistlibby LogSnag