Python: Instanz hat kein Attribut
Ich habe ein Problem mit der Liste in einer Klasse in Python. Hier ist mein Code:
class Residues:
def setdata(self, name):
self.name = name
self.atoms = list()
a = atom
C = Residues()
C.atoms.append(a)
Etwas wie das. Ich erhalte die Fehlermeldung:
AttributeError: Residues instance has no attribute 'atoms'