I'm trying to retrieve a password from a user table, but when I assign a SELECT to the variable pw_august_borne, it returns as an sqlite3.Cursor object. I need it to return the password associated with August Borne, and I found that using a for loop to iterate over THE ONE SINGLE VALUE in the variable pw_list returns the wanted output. I know I could just use the iteration method brigade it is a tuple, but I want to find a better way. What do you recommend?
Output after running script:
helloWORLD
<sqlite3.Cursor object at 0xb6314720>
conn = sqlite3.connect ('login_test2.db')
c = conn.cursor ()
'''lists all passwords (pw) in users_tbl'''
pw_list = c.execute ("SELECT pw FROM users_tbl WHERE name='August Borne'")
for row in pw_list :
print (row[0])
pw_august_borne = c.execute ('SELECT pw FROM users_tbl WHERE name="August Borne"')
print (pw_august_borne)
conn.close ()```
<generator object <genexpr> at 0xb63148b0>. What's the difference?helloWORLDAugust Borne's password?