Keyword-Only Arguments in Python 3 - Printable Version +- QP School (https://qomplainerzschool.lima-city.de) +-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3) +--- Forum: Python 3 Tutorials and examples (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=51) +--- Thread: Keyword-Only Arguments in Python 3 (/showthread.php?tid=5068) |
Keyword-Only Arguments in Python 3 - Qomplainerz - 07-25-2023 def greet(name, *, prefix="Hello"): print(prefix + ", " + name) greet("John", prefix="Hi") # Output: Hi, John |