Commit 02271f31 authored by muris2016's avatar muris2016
Browse files

Version simplificada

parent 96d5a355
# -*- coding: utf-8 -*-
from sys import argv
import calcoohija
import calcoo
def operating(calculator, operation, numbers):
ans = int(numbers[0])
for num in numbers[1:]:
ans = calcoo.do_operation(calculator, operation, ans, int(num))
if __name__ == "__main__":
script, filename = argv
file = open(filename)
calculator = calcoohija.CalculadoraHija()
for line in file.readlines():
operation = line.split(',')[0]
numbers = line.split(',')[1:]
operating(calculator, operation, numbers)
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