I am trying to create a python3 module in Sqlite. The goal is to call the module and create a table with 10 rows. Each row should contain only one number (1-10). Once called up, I wish the module (called E4.py) to provide the largest number in the table. So far, I have written the following code:
import sqlite3
db = sqlite3.connect("Exercise4.db")
db.isolation_level = None
db.execute("DROP TABLE Exc4")
db.execute("CREATE TABLE Exc4 (x INTEGER)")
for i in range(1,10+1):
db.execute("INSERT INTO Exc4 (x) VALUES(?)",(i+1))
Largest = db.execute("SELECT MAX(x) FROM Exc4").fetchone()[0]
print(Largest)
i = i + 1
When I call for the module in command prompt by "python3 E4.py", I get an error message "ValueError: parameters are of unsupported type".