Friday, 30 June 2017

Python Format

Cited from https://www.python.org/dev/peps/pep-3101/


"The story of {0}, {1}, and {c}".format(a, b, c=d)

    Within a format string, each positional argument is identified
    with a number, starting from zero, so in the above example, 'a' is
    argument 0 and 'b' is argument 1.  Each keyword argument is
    identified by its keyword name, so in the above example, 'c' is
    used to refer to the third argument.

No comments:

Post a Comment