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