This function converts a value to a formatted representation. The general form is:
format(value[,spec])
For built-in types, the has the syntax as
that described in Section 9.4, “The string spec.format() method”
between “:” and the
closing “}”.
>>> x = 34.56
>>> format(x, '9.4f')
' 34.5600'
>>> '{0:9.4f}'.format(x)
' 34.5600'
You can define how this function works for a
user-defined class by defining the special method
described in Section 26.3.13, “__format__: Implement the format() function”.
If the argument is omitted, the result is the same as
specstr(.
value)