Programming Languages
Python
Subjective
Sep 30, 2025
Explain Python's `*args` and `**kwargs` with a practical example.
Detailed Explanation
def my_function(*args, **kwargs):\n print("Args:", args)\n print("Kwargs:", kwargs)\n\nmy_function(1, 2, 3, name="John", age=25)\n# Args: (1, 2, 3)\n# Kwargs: {'name': 'John', 'age': 25}
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts