Skip to content

Instantly share code, notes, and snippets.

View Santisoutoo's full-sized avatar
✈️
Learning and working!

Santiago Santisoutoo

✈️
Learning and working!
View GitHub Profile
@Santisoutoo
Santisoutoo / keyword_only_parameters_demo.py
Created September 20, 2025 09:29
Python demo showing mandatory keyword-only parameters. Includes examples of incorrect and correct usage, with explanations of why keyword-only parameters must be named when calling the function.
"""
Demo: Mandatory keyword-only parameters in Python
"""
def greet(name, age, *, city):
"""
Example function:
- name: mandatory positional
- age: mandatory positional
- city: mandatory keyword-only