Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which statement about Python string immutability is correct?

  1. A Strings cannot be modified in place; operations return new strings
  2. B Strings can be modified by index assignment
  3. C Strings are mutable in Python 3
  4. D Only f-strings are immutable
Answer

Strings cannot be modified in place; operations return new strings

Building a string by repeated concatenation in a loop is therefore O(n squared). Use str.join() on a list instead.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as