[i]Learn· Input and Output
Old string formatting
The % operator (modulo) can also be used for string formatting.
Given format % values (where format is a string),
% conversion specifications in format are replaced with
zero or more elements of values.
This operation is commonly known as string
interpolation. For example:
>>> import math
>>> print('The value of pi is approximately %5.3f.' % math.pi)
The value of pi is approximately 3.142.
More information can be found in the printf-style String Formatting section.
example 1 of 1
[>_]Terminal
Output appears here when you press Run.
$ ▌