File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2339,7 +2339,13 @@ String objects have one unique built-in operation: the ``%`` operator (modulo).
2339
2339
This is also known as the string *formatting * or *interpolation * operator.
2340
2340
Given ``format % values `` (where *format * is a string), ``% `` conversion
2341
2341
specifications in *format * are replaced with zero or more elements of *values *.
2342
- The effect is similar to using the :c:func: `sprintf ` in the C language.
2342
+ The effect is similar to using the :c:func: `sprintf ` function in the C language.
2343
+ For example:
2344
+
2345
+ .. doctest ::
2346
+
2347
+ >>> print (' %s has %d quote types.' % (' Python' , 2 ))
2348
+ Python has 2 quote types.
2343
2349
2344
2350
If *format * requires a single argument, *values * may be a single non-tuple
2345
2351
object. [5 ]_ Otherwise, *values * must be a tuple with exactly the number of
You can’t perform that action at this time.
0 commit comments