May-05-2020, 03:31 PM
append is a function that returns None. It does not return the list with an appended value.
Your code does not make any sense. It does this:
tag[N].append(tag[N].get('data_id') for N in range(len(tag))
Your code does not make any sense. It does this:
tag[N].append(tag[N].get('data_id') for N in range(len(tag))
id = [] #<- This list is thrown away in the next line for id in tag: data_id = id.get('data-id') print(id.append(data_id),str(data_id)) #load id array list id.append(data_id) # This is id from the for loop