As shown in the following example, you can use the built-
in Python function help() to learn what a function does
and any methods that can be used:
Click here to view code image
>>> help(devnet)
Help on function devnet in module __main__:
devnet()
prints simple function
USING ARGUMENTS AND
PARAMETERS
An argument is some value (or multiple values) that you
pass to a function when you call the function within code.
Arguments allow a function to produce different results
and make code reuse possible. You simply place
arguments within the parentheses after a function name.
For example, this example shows how you can pass
multiple numeric arguments to the max() function to
have it return the largest number in the list:
>>> max(50, 5, 8, 10, 1)
50
Each function must define how it will use arguments,
using parameters to identify what gets passed in and how
it gets used. A parameter is simply a variable that is used
in a function definition that allows code within the
function to use the data passed to it. To get results back
from the function, you use the keyword return and the
object you want to pass back. The following example
shows how to create a function that subtracts two
numbers and stores the result in a local variable called
result that gets returned when the function is called: