import sqlite3
# connect to the database
conn = sqlite3.connect("pokemon.db")
# reset the counts for all caught pokemon to 0
conn.execute("UPDATE caught_pokemon SET count = 0")
# commit the changes
conn.commit()
# close the connection
conn.close()
While not going to cause a crash, you don’t need to import sqlite3 and initialize the database twice.
The command you’re calling to reset is not going to work as expected here, you need to (AFAIK) set each key to 0 in the Database using a for loop or something similar.
That will cause an error, because you call sqlite3 before it is defined now. Please put the import back at the top, and remove the one below the get_shiny_chance function.
Line 20 is incorrect because it is indented when the program did not expect it. That line, and through line 26 can all be removed, as you removed the function that was using those lines.
Also, you still have an extra sqlite3 import on line 30.
Since you already removed the function that was using them, you might as well. Alternatively you could just comment those lines out for now (start the lines with a #)
Since you close the database on line 10, subsequent writes will fail, as would any write after line 63. Try removing or commenting out lines 10 and 63.