How can I use append with each?

Hey, I tried to run this code:

import csv
isbn_list = []
with open("books.csv") as books_csv:
  books_reader = csv.DictReader(books_csv, delimiter='@')
  for each in books_reader:
    isbn_list.append[each["ISBN"]]
    

But I’m getting an error: TypeError: 'builtin_function_or_method' object is not subscriptable

Why does the error appear here, if it doesn’t appear in case of this code:

(SOLUTION CODE):

import csv

with open('books.csv') as books_csv:
  books_reader = csv.DictReader(books_csv, delimiter='@')
  isbn_list = [book['ISBN'] for book in books_reader]

It’s really confusing why I accent elements to that list, even thought I am reffering to the very same elements in the loop.

.append() is a method, not a data structure so is not subscriptable.

list.append(each['ISBN'])

I see, thanks. So technically if I used a temporary list to hold ‘each’ and then overwritten isb_list instead of append it should work?

each['ISBN']

uses a key which is the syntax for accessing an attribute value in a dict object called each.