HomeInterview QuestionsWhat are *args and **kwargs in Python?

What are *args and **kwargs in Python?

🟢 Easy Conceptual Junior level
1Times asked
Jul 2026Last seen
Jul 2026First seen

💡 Model Answer

*args is a syntax that collects any extra positional arguments into a tuple, allowing a function to accept an arbitrary number of positional parameters. **kwargs collects any extra keyword arguments into a dictionary, enabling a function to accept arbitrary keyword parameters. They are useful for wrapper functions, decorators, or when the exact number of arguments is not known in advance.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500