I have a problem in Python which is the one above, I tell you what the program is about, the user enters a word in this case "MARKET" and gives a value of "10000" is repeated in the following, but when the detail is shown, two or intermediate of the two are repeated and it does not show the name [SEE RED PICTURE IMAGE], since 1 week ago I have this problem and I have not been able to solve it, I need the help to solve this, they are grateful .
The code is:
arregloDeGastos = []
gastos = []
sumaTotal = 0
nombreGasto = {}
salir = ("")
variable = 0
def detalles():
sumaTotal = 0
for i in range(len(arregloDeGastos)):
print("Sus gastos en detalle fueron:" , arregloDeGastos[i])
sumaTotal += arregloDeGastos[i]
print("Sus gastos totales fueron: ", sumaTotal)
print()
salario = int(input("Ingresa tu salario: "))
sumaTotal = salario - sumaTotal
print("Lo que te queda libre es,", sumaTotal,"Recuerda ahorrar.")
return sumaTotal
while salir != "salir":
print()
salir = input("DALE ENTER PARA CONTINUAR, DE LO CONTRARIO salir: ")
if(salir != "salir"):
arregloDeGastos.append(int(variable))
nombre = input("Digite el nombre del gasto: ")
for j in range(1):
print("Digite el valor del gasto",nombre,": ")
gasto = int(input())
arregloDeGastos.append(gasto)
nombreGasto[nombre] = gastos
gastos = []
sumaTotal = 0
detalles()