← Back to challenges

Count the Arguments

PythonHardlanguage_fundamentalsfunctional_programming

Instructions

Create a function that returns the number of arguments it was called with.

Examples

num_args() ➞ 0

num_args("foo") ➞ 1

num_args("foo", "bar") ➞ 2

num_args(True, False) ➞ 2

num_args({}) ➞ 1

Notes

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Where is Bob!?!