Hi @laurenk9304
Below is the first 3 rows of potus
[['Joshua T. Blanton',
'2014-12-18T00:00:00',
datetime.datetime(2015, 1, 6, 9, 30),
'1/6/15 23:59',
'',
'potus',
'west wing',
'JointService Military Honor Guard'],
['Jack T. Gutting',
'2014-12-18T00:00:00',
datetime.datetime(2015, 1, 6, 9, 30),
'1/6/15 23:59',
'',
'potus',
'west wing',
'JointService Military Honor Guard'],
['Bradley T. Guiles',
'2014-12-18T00:00:00',
datetime.datetime(2015, 1, 6, 9, 30),
'1/6/15 23:59',
'',
'potus',
'west wing',
'JointService Military Honor Guard']
When you say
for row in potus:
it selects the below list and saves it to the iterating variable called row
['Joshua T. Blanton',
'2014-12-18T00:00:00',
datetime.datetime(2015, 1, 6, 9, 30),
'1/6/15 23:59',
'',
'potus',
'west wing',
'JointService Military Honor Guard'],
then the next line says row[2]
, it selects the item at index 3 (remember indexing starts from 0)
So you are actually selecting the element in 3rd column or column[2]
Don’t get confused with the variable name we have given as row
I hope this helps