strange use of %s

Tracubik affdfsdfdsfsd at b.com
Mon Apr 18 04:29:14 EDT 2011


Hi all,
i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've 
found this strange use of %s:

sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s%
%'" %response

response is a string. I've newbie in sql.

why do the coder use %%%s%% instead of a simple %s?
why he also use the ''?

thanks in advance for you attention/replies

Nico



More information about the Python-list mailing list