Functions · Lesson 41 of 76

Parameters

Parameters are the inputs a function accepts — the values you put in the brackets when you call it.

Python

You can give a parameter a default value, used when the caller doesn't supply one:

Python

Your turn: write power(base, exponent=2) that returns base ** exponent, and print power(5) and power(2, 3).

Check your understanding

You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →

Lesson 41 of 76