Printing "%"

Steve Purcell stephen_purcell at yahoo.com
Thu Mar 29 11:31:28 EST 2001


Mix wrote:
> How do you print a percenrage (%)sign in Python?
> I tried :
>   return "select * from fax where id LIKE '%s\%'" %ident

Do the following:

    >>> "%i%%" % 85
    '85%'

Or, in your case,

    return "select * from fax where id LIKE '%s%%'" %ident

-Steve


-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Any opinions expressed herein are my own and not necessarily those of Yahoo




More information about the Python-list mailing list