unzwar habe ich folgendes Script verfasst und verstehe nicht wo der Fehler liegt.
Code: Alles auswählen
class Konto:
def __init__(self,Kontostand,Kontoinhaber,Kontokorrent=0):
self.Kontostand = Kontostand
self.Kontoinhaber = Kontoinhaber
self.Kontokorrent = Kontokorrent
def Geld_einzahlen(Einzahlung,self):
self.Kontostand += Einzahlung #a+=b = a=a+b
def Geld_auszahlen(Auszahlung,self):
self.Kontostand -= Auszahlung
def Kontostand_ueberpruefen(self):
return self.Kontostand
def Kontoauszug(self):
return self.Kontoinhaber ,"hat", self.Kontostand ,"€ auf seinem Konto"
def ueberweisen(self, ziel, betrag):
if(self.Kontostand - betrag < -self.Kontokorrent):
print "Deckung nicht genuegend"
# Deckung nicht genuegend
return False
else:
self.Kontostand -= betrag
ziel.Kontostand += betrag
return True
class Kreditkonto(Konto):
def __init__(self,Kontostand,Kontoinhaber,Kredit,Kontokorrent=0):
Konto.__init__(self,Kontostand,Kontoinhaber,Kontokorrent)
self.Kredit = Kredit
def Kontoauszug(self):
return Konto.Kontoauszug(self) + "und der Kreditrahmen liegt bei" + self.Kredit
if __name__ == "__main__":
x = Kreditkonto("1000","Martin L.","500")
print x.Kontoauszug()
()
Der Error:
[error] script [ *Kontostand ] stopped with error in line 40
[error] TypeError ( can only concatenate tuple (not "str") to tuple )
[error] --- Traceback --- error source first line: module ( function ) statement 36: main ( Kontoauszug ) return Konto.Kontoauszug(self) + "und der Kreditrahmen liegt bei" + self.Kredit
[error] --- Traceback --- end --------------
Danke im Vorhinein
MFG