Ad
  • Custom User Avatar

    Just to be clear, string interpolation is not a direct replacement for format. Interpolated strings are still hard-coded into the source code and cannot be changed at runtime, while with format, string templates can be not just literals, but also variables with values fetched from some other place (for example translation resources etc.) and can be reloaded when program is running.

  • Default User Avatar

    I didn't really follow either and both those links seem to discuss using the "string{}".format method, which I think is already replaced by the f"string{var}" method.

    I mean, this is lovely but I don't get how it works either. does it specifically only work on a tuple?