syntax difference

Chris Angelico rosuav at gmail.com
Sun Jun 17 01:35:34 EDT 2018


On Sun, Jun 17, 2018 at 3:30 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Sharan Basappa <sharan.basappa at gmail.com> writes:
>
>> I think I am now confused with format options in Python.
>
> You should refer to the documentation for string formatting
> <URL:https://docs.python.org/3/library/stdtypes.html#str.format>
> <URL:https://docs.python.org/3/library/string.html#formatstrings>
>
> (or, if you want to continue with the older less-flexible style,
> <URL:file:///usr/share/doc/python3/html/library/stdtypes.html#printf-style-string-formatting>)

For the record, there's nothing at all wrong with printf-style
formatting; its flexibility and brevity make it extremely useful in
many situations.

ChrisA



More information about the Python-list mailing list