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 is the recommended way to format strings in modern Python?

  1. A f-strings
  2. B The % operator
  3. C String concatenation
  4. D str.format() only
Answer

f-strings

f-strings are more readable and faster because formatting is evaluated at compile time into efficient bytecode.

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