Skip to content

Instantly share code, notes, and snippets.

@PeterJatschka
Last active September 8, 2016 08:07
Show Gist options
  • Save PeterJatschka/f466c70815797470ccd991ae2269981a to your computer and use it in GitHub Desktop.
Save PeterJatschka/f466c70815797470ccd991ae2269981a to your computer and use it in GitHub Desktop.
menu=[]
while True:
meal=raw_input("Welche Speise wollen Sie dem Menu hinzufuegen: ")
price=raw_input("Was kostet diese Speise: ")
new_meal={"Speise":meal, "Preis":price}
menu.append(new_meal)
abbruch=raw_input("Bist du fertig mit deinen Eintraegen? (J) ")
if abbruch.lower()=="j":
break
for i in menu:
print i
menu_file=open("menu.txt","w")
menu_file.write("Menu:\n")
for speise in menu:
menu_file.write(speise["Speise"]+": "+speise["Preis"]+"€\n")
menu_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment