Learning Python - Calculator Code does not work
Archiviert 2 years ago
S
Seanator
I'm trying to learn Python and for this reason im trying to do a Calculator. I tried with ChatGPT or some hours long googeling, but I didin't fount anything that solve my problem or just making other problems. Because of my lack of knowledge, I don't know what exactly the problem is. ChatGPT thinks is somewhere in the beginning of the code, but i think it's some wehere in the middle of the Code.
I hope someone wants to help me and can give some advice about the code in generally (whats is especially good or bad).
ChatGPT thinks the mistake is some where in def: three_two
I think is in def: berechnen_drei_zahlen
If I trying to run the code I getting a Traceback arround line 49 ( print ("Deine Rechnung: ", zahl_eins, " ", operator1, " ", zahl_zwei, " ", operator2, " ", zahl_drei ) )
Traceback give me the following information, but I don't know what it wants to tell me:
Traceback (most recent call last):
File "/Volumes/T7 Coding/MacOS/Programmieren/Python/Projekte/Taschenrechner/calculater_new.py", line 178, in <module>
three_two()
File "/Volumes/T7 Coding/MacOS/Programmieren/Python/Projekte/Taschenrechner/calculater_new.py", line 23, in three_two
if not berechnung_drei_zahlen(zahl_drei, zahl_zwei, zahl_drei, operator1, operator2):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Volumes/T7 Coding/MacOS/Programmieren/Python/Projekte/Taschenrechner/calculater_new.py", line 55, in berechnung_drei_zahlen
calculation(zahl_eins, zahl_zwei, operator1, True)
TypeError: calculation() missing 2 required positional arguments: 'operator2' and 'eingabe_zwei_drei'
If you need more Information, just ask for it and thanks for everyone who wants to help me. :)
