If I have a string like:
"{0} {1} {1}" % ("foo", "bar")
and I want:
"foo bar bar"
What do the replacement tokens have to be? (I know that my example above is incorrect; I'm just trying to express my goal.)
"f" stands for floating point. The integer (here 3) represents the number of decimals after the point. "%. 3f" will print a real number with 3 figures after the point. – Kefeng91.
"{0} {1} {1}".format("foo", "bar")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With