Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
DELGADO VALENCIA, JORGE
ptavi-p2
Commits
02271f31
Commit
02271f31
authored
Sep 29, 2015
by
muris2016
Browse files
Version simplificada
parent
96d5a355
Changes
1
Hide whitespace changes
Inline
Side-by-side
calcplus.py
0 → 100644
View file @
02271f31
#!/usr/bin/python3
# -*- 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
))
print
(
ans
)
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
)
file
.
close
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment