The Answers till now have been templating the values/qualities into a plain SQL string. That is totally fine for numbers, yet in the event that we needed to do it for strings, we get the getting away from the issue.
Here's a variation utilizing a defined inquiry that would work for both:
placeholder= '?' # For SQLite. See DBAPI paramstyle.
placeholders= ', '.join(placeholder for unused in l)
query= 'SELECT name FROM students WHERE id IN (%s)' % placeholders
Want to learn python to get expertise in the concepts of python? Join python certification course and get certified