001 Functions
001 Functions
grumpus()
NO INPUTS
greet() "Hi!"
greet() "Hi!"
ARGUMENTS
We can also write functions that
accept inputs, called arguments
ARGUMENTS
greet('Tim') "Hi Tim!"
avg(3,2,5,6) 4
We've seen this before
No inputs
Arguments!
GREET TAKE 2
"33 and 33
are equal"
RETURN
Built-in methods return
values when we call them.
We can store those values:
NO RETURN!
Our functions print values out,
but do NOT return anything
FIRST RETURN!
Now we can capture a return
value in a variable!
RETURN
The return statement ends function
execution AND specifies the value to
be returned by that function
PRACTICE