The circled code prints “Alligators have whiskers” for me is this a mistake or am I reading this wrong. Using repl to run the code. Also can you guys help me understand the syntax that its trying to explain to me on the bottom between following default and non default arguments that has me a bit confused.
Cats would be used if no argument is provided for animal. But an argument is provided
Why does it say "All three code blocks correctly output “Cats have whiskers”. I see what you mean now but perhaps that note could be changed, just misinterpreted that. Thanks.
Then the quiz is doing a good job. Understanding requirement (or answers in this case), is so important.
What the notes at the bottom mean is that when defining a function, the positional arguments must always come before a keyword argument.
def facts(animal, noun = 'whiskers'):
Where animal is the positional argument and noun is the keyword argument.
That must be always there order. If you do this: you’ll get an error:
def facts(noun = 'whiskers', animal):
I hope you understand now.