Printing "%"

Kalle Svensson kalle at
Thu Mar 29 18:24:18 CEST 2001

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

Use double %-sign:
  return "select * from fax where id LIKE '%s%%'" % ident

Email: kalle at     | You can tune a filesystem, but you
Web: | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD
 [ Not signed due to lossage.  Blame Microsoft Outlook Express. ]

More information about the Python-list mailing list