QuestenaPractice that shows what to review next
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.Correct answer
  3. The source string is mutated after a field is evaluated.
  4. Each replacement expression is evaluated before its value is formatted.Correct answer

Explanation

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.

Continue with this test

Start practice
Question 24: For Python formatted string literals, which statements are… · Python Fundamentals · Questena