Advertisement
cardel

Solucion reto 3

Jun 14th, 2021
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.76 KB | None | 0 0
  1. def resumen_producion(produccion_te_gas: tuple, produccion_te_sin_gas: tuple) -> dict:
  2.     salida = {}
  3.  
  4.     total_te_gas = 0
  5.     for elm in produccion_te_gas:
  6.         total_te_gas+=elm
  7.    
  8.     costo_prod_te_gas=total_te_gas*600
  9.     int_te_gas= total_te_gas*3100
  10.     ganancias_te_gas = int_te_gas-costo_prod_te_gas
  11.  
  12.     salida["total_te_gas"]=total_te_gas
  13.     salida["costo_prod_te_gas"]=costo_prod_te_gas
  14.     salida["ing_te_gas"]=int_te_gas
  15.     salida["ganancia_te_gas"]=ganancias_te_gas
  16.  
  17.     #Te sin gas
  18.     total_te_sin_gas = 0
  19.     for elm in produccion_te_sin_gas:
  20.         total_te_sin_gas+=elm
  21.    
  22.     costo_prod_te_sin_gas=total_te_sin_gas*320
  23.     int_te_sin_gas= total_te_sin_gas*2200
  24.     ganancias_te_sin_gas = int_te_sin_gas-costo_prod_te_sin_gas
  25.  
  26.     salida["total_te_sin_gas"]=total_te_sin_gas
  27.     salida["costo_prod_te_sin_gas"]=costo_prod_te_sin_gas
  28.     salida["ing_te_sin_gas"]=int_te_sin_gas
  29.     salida["ganancia_te_sin_gas"]=ganancias_te_sin_gas
  30.  
  31.     #Totales
  32.     costo_prod_total = costo_prod_te_gas+costo_prod_te_sin_gas
  33.     salida["costo_prod_total"]=costo_prod_total
  34.  
  35.     ing_total=int_te_gas+int_te_sin_gas
  36.     salida["ing_total"]=ing_total
  37.  
  38.     ganancia_total=ganancias_te_gas+ganancias_te_sin_gas # ing_total - costo_prod_total
  39.  
  40.     salida["ganancia_total"]=ganancia_total
  41.     """
  42.    Tambien puede hacerse asi.
  43.    {{"total_te_gas": total_te_gas,"costo_prod_te_gas": costo_prod_te_gas,"ing_te_gas": ing_te_gas,"ganancia_te_gas": ganancia_te_gas,
  44.    "total_te_sin_gas": total_te_sin_gas,"costo_prod_te_sin_gas": costo_prod_te_sin_gas,"ing_te_sin_gas": ing_te_sin_gas,
  45.    "ganancia_te_sin_gas": ganancia_te_sin_gas,"costo_prod_total": costo_prod_total,"ing_total": ing_total,"ganancia_total": ganancia_total}}
  46.    """
  47.     return salida
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement