Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 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 3الإجابة الصحيحة
  4. The product 6

الشرح

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.

تابع هذا الاختبار

بدء التدريب
السؤال 79: Given def total(*args): return args, what does args receive… · Python Fundamentals · Questena