# syntax # def (, , ..., =, =, ...): # ... # optional syntax (documentation, linter hints) # def (:, :=): # ... def greet_from_list(greeting: str, name_list: list=None): # ^^^^^^^^^ # watchout for mutable types as default values ie don't do name_list=[] !! # instead do: name_list=None # and then check if user user has provided a value: if name_list is None: name_list = ["World"] for name in name_list: print(f"{greeting} {name}!") if '__main__' == __name__: greet_from_list("Hi", ["Bob", "Jack"]) # >>> Hi Bob! # >>> Hi Jack! # positional parameters can also be set "as" keyword parameters greet_from_list(greeting="Hello") # >>> Hello World!