I currently have a list
outcomes = [('A','B','C','A.B','A.C','B.C','A.B.C')]
and I am trying to loop over it. If one of the "name" in the list contains a A, then I want to create another list called column_names with that name in it. For instance, if I am looking for As, my returning list would be:
column_names = ['A','A.B','A.C',A.B.C']
I have the following code:
column_names = []
for name in outcomes:
if 'A' in name:
column_names = column_names.append(name)
but it returns:
AttributeError: 'NoneType' object has no attribute 'append'
I checked and both column_names and outcomes are lists so I dont understand why.