[Tutor] How does formatted printing work?

Dave Angel davea at davea.name
Sun Jun 9 01:02:27 CEST 2013


On 06/08/2013 06:10 PM, Michael Sparks wrote:
> I believe it's % string interpolation where % formats strings
> I'm reading Practical Programming and I'm stuck on page 35, question 6. b)
> where:
> "___" % 34.5 => "3.45e+01"
>
>

By top-posting, you ruined all context.

For Python 2.x, here's the documentation link for string interpolation 
using the "%" operator.

http://docs.python.org/2/library/stdtypes.html#string-formatting-operations




-- 
DaveA


More information about the Tutor mailing list