Mixing positional and named parameters


We have already seen several built-in functions where we mixed positional arguments with some key-value arguments.

examples/functions/mixed_params.py
fname = "Foo"
lname = "Bar"
animals = ["snake", "mouse", "cat", "dog"]

print(fname, lname, sep="-", end="\n\n")

by_length = sorted(animals, key=len, reverse=True)
print(by_length)

Foo-Bar

['snake', 'mouse', 'cat', 'dog']