.. getthecode:: strings.py :language: python3 :hidden: ========= Strings ========= This page contains a memo on strings. .. code-block:: py3 import decimal from Tools import * Formatted string literals ------------------------- :frompy:`3.6` `PEP 498 - Formatted string literals `_ .. code-block:: py3 name = "Fred" print(f"He said his name is {name}.") .. code-block:: none He said his name is Fred. .. code-block:: py3 width = 10 precision = 4 value = decimal.Decimal("12.34567") print(f"result: {value:{width}.{precision}}") # nested fields .. code-block:: none result: 12.35