I have the following code in Python and I am an unsure about how the for loop here is working.
cur.execute("SELECT CUST_ID, COMPANY, LASTNAME, CITY, STATE FROM
mytable")
colnames = [desc[0] for desc in cur.description]
How does this for work ?
[desc[0] for desc in cur.description]
What is desc[0
]?