Very stupid question about a % symbol

Tim Chase python.list at tim.thechases.com
Thu Sep 16 12:14:19 EDT 2010


On 09/16/10 10:25, J wrote:
> OK, this is a very stupid question about a very simple topic, but
> print "Reported memory amounts are within %s%s tolerance" %
> (self.mem_tolerance,'%')
>
> Is there a better way to print a '%' in the string when also using formating?
>
> I've tried things like this:
>
> print "blahblahblah %s \%" % variable

So close

   print "blah %s %%" % variable

-tkc





More information about the Python-list mailing list