|
|
Subscribe / Log in / New account

Easier Python string formatting

Easier Python string formatting

Posted Sep 10, 2015 17:28 UTC (Thu) by josh (subscriber, #17465)
Parent article: Easier Python string formatting

> The format() string method is more flexible, but is somewhat verbose

.format() doesn't need to be any more verbose than the % operator, if you don't use names:

'The answer = {}'.format(42)


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds