N = int(input("Digite la cantidad de Artículos a facturar: "))
dataProd = ('Código', 'Nombre', 'Cantidad', 'Valor unitario', 'Tipo de IVA')
listdataProd = []
compra = {}
acuSubTotal= 0
acuIvatotal= 0
acuTotalprod= 0
for item in range(N):
listdataProd = []
for dato in dataProd:
listdataProd.append(input(f"Digite el {dato} del producto {item + 1}: "))
compra[item+1] = listdataProd
compra[item+1].append(int(compra[item+1][2]) * int(compra[item+1][3]))
iva = (0, 0.05, 0.19)
if int(compra[item+1][4]) == 1:
compra[item+1].append(float(compra[item+1][5]) * iva[0])
elif int(compra[item+1][4]) == 2:
compra[item+1].append(float(compra[item+1][5]) * iva[1])
else:
compra[item+1].append(float(compra[item+1][5]) * iva[2])
compra[item+1].append(int(compra[item+1][5]) + int(compra[item+1][6]))
acuSubTotal += compra[item+1][5]
acuIvatotal += compra[item+1][6]
acuTotalprod += compra[item+1][7]
print("\n****************")
print("Detalles de la compra: ")
print("****************")
for i in range(N):
print(f"\nCodigo del Producto {i + 1}: ", compra[item+1][0])
print(f"Nombre del Producto {i + 1}: ", compra[item+1][1])
print(f"Cantidad del Producto {i + 1}: ", compra[item+1][2])
print(f"Valor Unitario del Producto {i + 1}: ", compra[item+1][3])
print(f"Tipo de Iva del Producto {i + 1}: ", compra[item+1][4])
print(f"Subtotal del Producto {i + 1}: ", compra[item+1][5])
print(f"Iva del Producto {i + 1}: ", compra[item+1][6])
print(f"Valor Total del Producto {i + 1}: ", compra[item+1][7])
print("\n****************")
print("Totales de la compra: ")
print("****************")
print("SubTotal de la compra: ", acuSubTotal)
print("IVA Total de la compra: ", acuIvatotal)
print("Total de la compra: ", acuTotalprod)
Hi! Im just getting started on the coding world and now I'm in a bit a pickle. When I print the outgoing information is only showing the last input requested N times, at the end of the code the math is adding up, so I know for sure all the information is in the dictionary but it is just not properly printing! I'm reading you guys! Thanks!!