QuestenaПрактика, после которой понятно, что повторить
Вопрос 24

For Python formatted string literals, which statements are true? Select all that apply.

  1. Replacement fields remain unchanged as literal text.
  2. A field may contain an expression rather than only a name.Правильный ответ
  3. The source string is mutated after a field is evaluated.
  4. Each replacement expression is evaluated before its value is formatted.Правильный ответ

Объяснение

A replacement field evaluates its Python expression and then formats the resulting value into the new string. The field is not preserved as literal source text, and evaluation is not limited to looking up a bare variable name.

Продолжить работу с тестом

Начать тренировку
Вопрос 24: For Python formatted string literals, which statements are… · Python Fundamentals · Questena