loop
How functions communicate with their environment

Module 4 · How functions communicate with their environment · Lesson 5 of 5

Quiz

Five questions on parameters, positional order, and keyword arguments. Work out each result in your head before you pick.

1

In def greet(name):, what is name?

2

What does this print?

def f(a, b):
    print(a - b)

f(10, 3)
3

Which call gives the SAME result as area(width=3, height=4)?

def area(width, height):
    return width * height
4

What happens here?

def f(a, b):
    print(a, b)

f(a=1, 2)
5

Which call is valid for def order(item, qty, gift):?

That's how data flows into a function. The other half — handing a result back out with return — is where functions go next.