Hallo Leute, ich bin neu hier.AttributeError: 'NoneType' Objekt hat kein Attribut
Ich bin Arbeit mit Python und ich brauche eine Funktion in der Klasse wie
class asas(object):
def b(self):
self.name = "Berkhan"
a = asas()
a.b().name
und ich überprüfen, um dieses Modul
Traceback (most recent call last):
File "C:\Users\Berkhan Berkdemir\Desktop\new 1.py", line 5, in <module>
a.b().name
AttributeError: 'NoneType' object has no attribute 'name'
was soll ich tun?
'name' ist ein Attribut der Instanz, so sollten Sie' a.b tun() 'und in einem zweiten Schritt' print (a.name) '. – Matthias