Inside a function, what types do *args and **kwargs collect?
A
A tuple and a dictionary
Correct answer
B
A dictionary and a tuple
C
Two separate lists
D
A list and a set
Correct answer
A. A tuple and a dictionary
20 views
⚔️
Challenge a friend on Python
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
*args gathers extra positional arguments into a tuple, and **kwargs gathers extra keyword arguments into a dict, which lets functions accept flexible inputs.
Reference
Asked in: NTS, Python Developer Interviews
Doubts & discussionNot sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ def add(item, box=[]): box.append(item); return box. What does calling add(1) and then add(2) return the second time? Next MCQ › In Python, a decorator is: