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"
On Sat, Jun 8, 2013 at 11:03 AM, Steven D'Aprano <st...@pearwood.info>wrote: > On 09/06/13 01:58, Michael Sparks wrote: > >> You can explain it yourself or just drop me a link (or both). >> Right now I'm learning Python 2.x but I plan on learning Python 3.x as >> well. >> > > > Formatted printing? First you format something, then you print it. > > Other than that, you will need to explain your question in more detail. I > can't read your mind, so I don't know if you're having trouble > understanding "formatting" (which formatting? there are at least four > things which might be described as "formatting") or "printing" (which > printing? there are at least three things which might be described as > "printing"). > > So please don't assume that just because a question is clear and obvious > in your mind, it is necessarily clear and obvious to everyone else. > > > And for the record: > > 1) format() built-in function; > 2) str.format() method; > 3) % string interpolation; > 4) string templates; > > and > > 1) printing to an actual printer; > 2) print statement; > 3) the pprint ("pretty printing") module. > > > > -- > Steven > > ______________________________**_________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor> >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor