I put them in context, I have the following code:
opcion = int(input("ingrese mesa: "))
if opcion == 1:
opcion2 = int(input("ingrese plato (0 para terminar): "))
while opcion2 != 0:
carta()
x = opcion2 - 1
mesa6.append((nombres[x],precios[x],tipos[x]))
c6 += 1
opcion2 = int(input("ingrese plato (0 para terminar): "))
And I need a function that makes a summation of all the prices that were added to the mesa6 list that is within the last while , the truth is that I do not have many ideas, but I had thought about doing a for cycle that would go through the mesa6 list in a range of the variable c6 but given that I have to do it in a general for 6 different list I do not know how to formulate it.
They will understand better seeing the complete code, I already had problems for the append to the table [x] list since I wanted it to be a function that could vary according to the variable x but I did not know how, so my code got a little big with so many if :