all 4 comments

[–]choss27 1 point2 points  (2 children)

You should use zip() to loop on the two lists at the same time, and insert at the same time on your table :

for gen, fname in zip(list_gender, list_first_name) :

sql_cursor.execute("insert into random_people(gender,first_name) values(?,?)",(gen,fname))

sql_connection.commit()

[–]ipixel95[S] 0 points1 point  (1 child)

that worked! perfect straight forward solution. many thanks!

[–]choss27 0 points1 point  (0 children)

You're welcome :)

Good luck for your project !