Calling functions
Functions can accept arguments (additional bits of data) and return values. The
capability to exchange data makes functions far more useful than they otherwise
might be. The following sections describe how to call functions in a variety of
ways to both send and receive data.
Sending requirement arguments
A function can require the caller to provide arguments to it. A required argument
is a variable that must contain data for the function to work. Open a copy of IPy-
thon and type the following code:
def DoSum(Value1, Value2):
return Value1
+ Value2
CHAPTER 4
Do'stlaringiz bilan baham: |