PRACTICE / UNDERSTAND / REPEAT

Python practice question

Practice strings with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

1 questionAnswers explainedFree · no login

Try this question

Strings · MCQQuestion link ↗

Does str.replace mutate the original string?

Choose one answer
Answer & explanation

Answer: No; it returns a string result

Python strings are immutable. Bind the returned value when you need the modified text.