How to calculate the total money sold by each vendor, and the number of units sold of each product

0

Here in the image you will see the approach and the exercise as I carry it. and I also leave the code, just missing the last part of the exercise where you must calculate the total money sold by each seller, and the number of units sold of each product.

todosLosIngresos=[]
for x in range(5):
	print("*************************** Ingreso",x+1," ***************************")
	cadaVenta=[]
	codVendedor = int(input('Introduce codigo del Vendedor un número entre 1000 y 5000, y multiplo de 10: '))
	while codVendedor<1000 or codVendedor>5000 or codVendedor%10!=0:
	    print("Por favor, el número ha de ser un número entre el 1000 y el 5000 y multiplo de 10.")
	    codVendedor = int(input('Introduce codigo del Vendedor un número entre 1000 y 5000, y multiplo de 10:   '))
	cadaVenta.append(codVendedor)

	codProducto = input('Introduce codigo del Producto (R) - (L) - (J): ')
	while codProducto!="R" and codProducto!="L" and codProducto!="J":
	    print("Por favor, el codigo del Producto ha de ser (R) - (L) - (J)")
	    codProducto = input('Introduce codigo del Producto (R) - (L) - (J): ')
	cadaVenta.append(codProducto)

	cantidadUnidadesVendidas = int(input('Cantidad Unidades Vendidas: '))
	while cantidadUnidadesVendidas<=0:
	    print("Por favor, debe ser un numero Positivo")
	    cantidadUnidadesVendidas = int(input('Cantidad Unidades Vendidas:  '))
	cadaVenta.append(cantidadUnidadesVendidas)

	if codProducto=="R":
		precio=cantidadUnidadesVendidas*209900
	elif codProducto=="L":
		precio=cantidadUnidadesVendidas*320000
	elif codProducto=="J":
		precio=cantidadUnidadesVendidas*450000

	cadaVenta.append(precio)
	todosLosIngresos.append(cadaVenta)

print (todosLosIngresos)
    
asked by enyoecd 10.11.2018 в 20:44
source

0 answers