Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sem3-ivt19-task1-1-mozgovoy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Мозговой Никита Александрович
sem3-ivt19-task1-1-mozgovoy
Commits
717fb1b8
Commit
717fb1b8
authored
Dec 24, 2020
by
Мозговой Никита Александрович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final
parent
5da40977
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
8 deletions
+23
-8
calculate.cpython-38.pyc
__pycache__/calculate.cpython-38.pyc
+0
-0
calc-history.log.txt
calc-history.log.txt
+19
-0
calcprint.py
calcprint.py
+0
-2
calculate.py
calculate.py
+4
-6
No files found.
__pycache__/calculate.cpython-38.pyc
View file @
717fb1b8
No preview for this file type
calc-history.log.txt
View file @
717fb1b8
...
...
@@ -106,3 +106,22 @@
2020-12-24 14:43:56.112465 : * : (3.2, 5.6, 1) = 17.92
2020-12-24 14:43:56.112465 : ^ : (5, 3) = 125.0
2020-12-24 14:43:56.112465 : + : (3.2, 5.4, 1.0, 6) = 15.6
2020-12-25 00:20:12.235082 : - : (2, 10.34) = -8.34
2020-12-25 00:20:12.257026 : - : (8, 2.3, 0, 4.55) = 1.15
2020-12-25 00:20:12.258056 : / : (25, 5.0, 2.5) = 0.092
2020-12-25 00:20:12.262011 : * : (3.2, 5.6, 1) = 17.92
2020-12-25 00:20:12.264005 : ^ : (5, 3) = 125.0
2020-12-25 00:20:12.265004 : + : (3.2, 5.4, 1.0, 6) = 15.6
2020-12-25 00:20:58.650001 : - : (2, 10.34) = -8.34
2020-12-25 00:20:58.650973 : - : (8, 2.3, 0, 4.55) = 1.15
2020-12-25 00:20:58.651994 : / : (25, 5.0, 2.5) = 2.0
2020-12-25 00:20:58.654962 : * : (3.2, 5.6, 1) = 17.92
2020-12-25 00:20:58.655959 : ^ : (5, 3) = 125.0
2020-12-25 00:20:58.656983 : + : (3.2, 5.4, 1.0, 6) = 15.6
2020-12-25 00:21:29.247291 : - : (2, 10.34) = -8.34
2020-12-25 00:21:29.248288 : - : (8, 2.3, 0, 4.55) = 1.15
2020-12-25 00:21:29.249322 : / : (25, 5.0, 2.5) = 2.0
2020-12-25 00:21:29.251219 : * : (3.2, 5.6, 1) = 17.92
2020-12-25 00:21:29.251219 : ^ : (5, 3) = 125.0
2020-12-25 00:21:29.252207 : + : (3.2, 5.4, 1.0, 6) = 15.6
2020-12-25 00:21:38.548252 : / : (4.0, 5.0) = 0.8
calcprint.py
View file @
717fb1b8
...
...
@@ -10,8 +10,6 @@ def print_results(*args, action=None, result=None):
operands
=
args
[:
len
(
args
)]
print
(
'inp_args in pretty mode'
,
operands
,
action
,
result
)
from
string
import
ascii_lowercase
# print(ascii_lowercase)
def
argsPrint
(
operands
):
lst
=
[]
for
i
in
operands
:
...
...
calculate.py
View file @
717fb1b8
...
...
@@ -24,9 +24,7 @@ def load_params(file="params.ini"):
for
l
in
lines
:
param
=
l
.
split
(
'='
)
param
[
1
]
=
param
[
1
]
.
strip
(
'
\n
'
)
if
param
[
0
]
!=
'dest'
:
param
[
1
]
=
eval
(
param
[
1
])
param
[
1
]
=
eval
(
param
[
1
])
PARAMS
[
param
[
0
]]
=
param
[
1
]
...
...
@@ -118,11 +116,11 @@ def calculate(*args, action=None, **kwargs):
if
action
==
'/'
:
result
=
args
[
0
]
if
0
in
args
[
1
:
len
(
args
)]:
return
'Деление невозможно'
else
:
try
:
for
n
in
args
[
1
:(
len
(
list
(
args
)))]:
result
/=
n
except
ZeroDivisionError
:
return
"Ошибка деления на ноль"
if
action
==
'^'
:
result
=
args
[
0
]
...
...
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