fields = ['id', 'name', 'row3', 'row4']
values = ['b', 'diego', 3, 4]
fields_str = (", ").join([x for x in fields])
values_str = (", ").join([("'" + str(x) + "'") for x in values])
cursor.execute("INSERT IGNORE INTO a (" + fields_str + ") VALUES (" + values_str + ")")
Printing the value of the concatenated string returned this for me:
INSERT IGNORE INTO a (id, name, row3, row4) VALUES ('b', 'diego', '3', '4')