warum gibt mir der zweite Print-Befehl nicht die Zahl 6 zurück, sondern den Hinweis
Code: Alles auswählen
<bound method Zahl.doppelt of <__main__.Zahl object at 0x02312130>>
Code: Alles auswählen
class Zahl:
def __init__(self, z=0):
self.z = z
def doppelt(self):
return z*2
x = Zahl(3)
print(x.z)
print(x.doppelt)
Danke & Gruß,
Gregor