Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###### menu.txt ########
- # porotos con rienda;50;Fondo
- # pastel de choclo;40;Fondo
- # humitas;25;Aperitivo
- # ceviche;35;Pescado
- # cazuela;80;Fondo
- # mote con huesillo;15;Postre
- # empanada;15;Aperitivo
- # guatitas arverjadas;80;Carne
- # asado;120;Carne
- names = []
- prices = []
- types = []
- table1 = []
- table2 = []
- table3 = []
- table4 = []
- table5 = []
- table6 = []
- def files():
- try:
- file = open("menu.txt","r",1,"utf-8")
- except:
- print("File not found")
- line = file.readline().strip()
- while line != "":
- parts = line.split(";")
- name = parts[0]
- prrice = int(parts[1])
- type = parts[2]
- names.append(name)
- prices.append(price)
- types.append(type)
- line = file.readline().strip()
- def menu():
- for i in range(len(names)):
- print(i+1," ",names[i], " ", prices[i], " ",types[i]," \n")
- def table():
- print("Put the table to serve...")
- print("1)")
- print("2)")
- print("3)")
- print("4)")
- print("5)")
- print("6)")
- option = int(input("Put table: "))
- while option != 0:
- menu()
- if option == 1:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table1.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- elif option == 2:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table2.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- elif option == 3:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table3.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- elif option == 4:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table4.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- elif option == 5:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table5.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- elif option == 6:
- option2 = int(input("Put the id of food (0 to end): "))
- while option2 != 0:
- menu()
- x = option2 - 1
- table6.append((names[x],prices[x],types[x]))
- option2 = int(input("Put the id of food (0 to end): "))
- option = int(input("Put table: "))
- def main():
- files()
- table()
- main()
- print("Resume of Table 1 is:\n", table1,"\n")
- print("Resume of Table 2 is:\n", table2,"\n")
- print("Resume of Table 3 is:\n", table3,"\n")
- print("Resume of Table 4 is:\n", table4,"\n")
- print("Resume of Table 5 is:\n", table5,"\n")
- print("Resume of Table 6 is:\n", table6,"\n")
Add Comment
Please, Sign In to add comment