PRACTICE / UNDERSTAND / REPEAT

Python: Strings

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

20 questionsAnswers explainedFree · no login
Question 1 of 20
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.