Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 106

When text is a string, which statement describes the value produced by text[1:3] and its effect on text?

  1. It is a character list that mutates text.
  2. It is a str value, and text is unchanged.پاسخ درست
  3. It is a view that can edit text.
  4. It is always a one-character string.

توضیح

Slicing a string produces another string value, while the original remains unchanged because strings are immutable. A list of characters would require a separate conversion, and assigning the result to a name cannot mutate the source.

ادامهٔ این آزمون

شروع تمرین
سؤال 106: When text is a string, which statement describes the value… · Python Fundamentals · Questena