Sep-04-2017, 11:11 AM
(This post was last modified: Sep-04-2017, 12:56 PM by hello_its_me.)
yea found it now but there is still a problem...... "zwischenschritt isn't defined and I have no idea how to do that because I just copy and paste the code from above so I have nooooooo idea could you guys explain to me how to do that? Good thing is it runs but only until line 19.
main = 1 behebung = 0 rechnung_kontostand = 0 ergebniss_kontostand = 0 ergebniss_kontostand2 = "" while main == 1: main = 0 print("Möchten Sie \n 1) Beheben \n 2) Einzahlen \n 3) Kontostand \n 4) Bewegungen \n 5) beenden") auswahl = input() if auswahl == "1": behebung = 1 while behebung == 1: behebung = 0 behebung_auswahl = input("Wieviel möchten Sie beheben?\n 1)50€ \t \t \t \t 2)100€ \n 3)200€ \t \t \t \t 4)500€ \n 5)800€ \t \t \t \t 6)1000€ \n") with open("kontostand.txt") as fin: for line in fin.readlines(): rechnung_kontostand = int(zwischenschritt) if auslesen_kontostand == "": print("Sie haben kein Konto!") behebung = 0 main = 1 if auslesen_kontostand != "": if behebung_auswahl == "1" and rechnung_kontostand >= -2250: ergebniss_kontostand = rechnung_kontostand - 50 ergebniss_kontostand2 = str(ergebniss_kontostand) print("Entnehmen Sie Ihre 50€") auslesen_kontostand = open("kontostand.txt", "w") with open("kontostand.txt", "w") as f: f.write(ergebniss_kontostand2) main = 1 if auswahl == "5": main = 0 print("Bis zum nächsten mal!") if auswahl != "1" and auswahl != "2" and auswahl != "3" and auswahl != "4" and auswahl != "5": print("Bitte geben Sie eine gültige Operation ein!") main = 1