QuestenaPractice that shows what to review next
Question 79

Given def total(*args): return args, what does args receive in the call total(2, 3)?

  1. A list containing 2 and 3
  2. A dictionary of keyword arguments
  3. A tuple containing 2 and 3Correct answer
  4. The product 6

Explanation

The starred parameter gathers unmatched positional arguments, preserving their order in a tuple. Treating args as a list or as a receiver for keyword arguments assigns it the wrong container or argument category.

Continue with this test

Start practice
Question 79: Given def total(*args): return args, what does args receive… · Python Fundamentals · Questena