QP School

Full Version: Keyword-Only Arguments in Python 3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
def greet(name, *, prefix="Hello"):
    print(prefix + ", " + name)

greet("John", prefix="Hi")  # Output: Hi, John