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
0f91fca4
Commit
0f91fca4
authored
Oct 05, 2015
by
muris2016
Browse files
Modificado con respecto a calc.py
parent
de658c50
Changes
1
Hide whitespace changes
Inline
Side-by-side
calcoo.py
View file @
0f91fca4
...
@@ -20,15 +20,12 @@ class Calculadora:
...
@@ -20,15 +20,12 @@ class Calculadora:
def
do_operation
(
calc
,
operation
,
op1
,
op2
):
def
do_operation
(
calc
,
operation
,
op1
,
op2
):
try
:
try
:
return
calc
.
operating
(
calc
.
operations
[
operation
],
op1
,
op2
)
return
calc
.
operating
(
calc
.
operations
[
operation
],
op1
,
op2
)
except
KeyError
:
except
KeyError
:
sys
.
exit
(
"Not allowed operation "
+
operation
)
sys
.
exit
(
"Not allowed operation "
+
operation
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
op1
=
calc
.
to_number
(
sys
.
argv
[
1
])
op1
,
operation
,
op2
=
calc
.
take_args
()
operation
=
sys
.
argv
[
2
]
op2
=
calc
.
to_number
(
sys
.
argv
[
3
])
calc
=
Calculadora
()
calc
=
Calculadora
()
print
(
do_operation
(
calc
,
operation
,
op1
,
op2
))
print
(
do_operation
(
calc
,
operation
,
op1
,
op2
))
Write
Preview
Supports
Markdown
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