Commit 6983fab5 authored by Gregorio's avatar Gregorio
Browse files

Error en el nombre de la variable y en la secuencia

parent 793fee07
......@@ -9,14 +9,14 @@ if __name__ == "__main__":
calcu = calcoohija.CalculadoraHija()
fichero = sys.argv[1]
diccionario = {"suma": calcu.suma, "multiplica": calcu.multiplica, "resta": calcu.resta, "divide": calcu.divide}
with open(fichero) as csvarchivo:
lineas = csv.reader(csvarchivo)
for linea in lineas:
operador = linea[0]
diccionario = {"suma": calcu.suma, "multiplica": calcu.multiplica, "resta": calcu.resta, "divide": calcu.divide}
if operador in ["suma", "multiplica", "resta","divide"]:
calcular = palabra[1]
for operaciones in palabra[2:]:
calcular = diccionario[operador](calcular, operaciones)
print(calcular)
if operador in ["suma", "multiplica", "resta","divide"]:
calcular = linea[1]
for operaciones in linea[2:]:
calcular = diccionario[operador](calcular, operaciones)
print(calcular)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment