QuestenaUn entraînement qui indique quoi revoir ensuite
Question 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.Bonne réponse
  3. The source string is mutated after a field is evaluated.
  4. Each replacement expression is evaluated before its value is formatted.Bonne réponse

Explication

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.

Continuer avec ce test

Commencer l’entraînement
Question 24: For Python formatted string literals, which statements are… · Python Fundamentals · Questena