The following code defines the get_customers() function that takes a connection as a parameter, creates a cursor, and gets all records from the Customer table, and returns them. Organize the following code and don't forget to close the cursor and the connection! Yes! In that order!
Working with SQLite
Select Data
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
customers = cursor.fetchall()
cursor = con.cursor()
cursor.execute('SELECT * FROM customers')
return customers
def get_customers(con):
con.close()
cursor.close()
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.