s = "SELECT * FROM %s WHERE %s = %s ORDER BY %s;"data = ['students', 'age', 12, 'desc']print s % tuple(data)
Standard input is empty
SELECT * FROM students WHERE age = 12 ORDER BY desc;
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!