Basically I want to be able to choose an amount of numbers using for x...in range(y amount of numbers) and inject them into an SQLite database. However I receive the following error:
line 17, in <module>
values (?)""") (number)
sqlite3.ProgrammingError: Incorrect number of bindings supplied.
The current statement uses 1, and there are 0 supplied.
Here is my non functioning code. All input is appreciated.:
import sqlite3
conn = sqlite3.connect("usernames.sqlite")
c = conn.cursor()
c.execute('''create table numbers (number)''')
for number in range(21):
# Insert a row of data
c.execute("""insert into numbers
values (?)"""),(number)
# Save (commit) the changes
conn.commit()
# We can also close the cursor if we are done with it
c.close()