wie es oben schon steht habe ich seit 3 Tage angefangen zu Coden. Ich würde gerne ein kleines Feedback bekommen ob ich auf dem rechten weg bin. Habe niemanden der mir es zeigt, bin mit Büchern und Videos am lernen nach der Arbeit. Habe bis jetzt erst die (Basics), wollte aber als ich angefangen habe mit diesem Code immer mehr und habe während dessen noch etwas über die If funktionen gelesen. Hoffe es ist nicht ganz so schlecht

Mit freundlichen Grüßen
Thylon
Code: Alles auswählen
Hack_need = int(200)
noodel_need = int(250)
#Welcome
print("Welcome to BuyingList Application for Spaghetti Bolognese!")
#ask for ingredient
Hack = input("How much Hackfleisch in gram do you have?: ")
result_Hack = int(Hack)
Diff_Hack = Hack_need - result_Hack
if result_Hack < Hack_need:
print("You need to buy " + str(Diff_Hack) + " gramm Hackfleisch!")
if result_Hack >= Hack_need:
print("You have enough Hackfleisch!")
noodel = input("How much noodle in gram do you have?: ")
result_noodel = int(noodel)
Diff_noodel = noodel_need - result_noodel
if result_noodel < noodel_need:
print("You need to buy " + str(Diff_noodel) + " gram Noodle!")
if result_noodel >= noodel_need:
print("You have enough Noodle!")
Oil = input("Did u have some Oil? ('Y' or 'N'): ")
if Oil == "Y":
print("You have enough!")
if Oil == "N":
print("You have to buy Oil!")
if result_Hack >= int("200") and result_noodel >= int("250") and Oil == "Y":
print("Bon Appetit, Have a nice day!")
if result_Hack < int("200") or result_noodel < int("250") or Oil == "N":
print("You need " + str(Hack_need) + " gram Hackfleisch, " + str(noodel_need) +
" gram noodle and Oil for Spaghetti Bolognese!")
print("This is ur List what you have to buy: ")
if result_Hack < Hack_need:
print(str(Diff_Hack) + " gram Hackfleisch!")
if result_noodel < noodel_need:
print(str(Diff_noodel) + " gram Noodle!")
if Oil == "N":
print("You have to buy Oil!")