Strings and % sign fails - Help Please

Jorge Godoy godoy at ieee.org
Fri Mar 24 03:57:43 CET 2006


siasookhteh at gmail.com writes:

> The following statement fails because it has the '%' sign in it.
> cursor.execute("select '%'")
>
> The error is: IndexError: list index out of range
>
> How do I address this problem?

Use "%%".


-- 
Jorge Godoy      <godoy at ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.



More information about the Python-list mailing list