Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AT_binary_tree_calculator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s8_ivanov_r
AT_binary_tree_calculator
Commits
5ebd7983
Commit
5ebd7983
authored
Nov 14, 2019
by
Roberts Ivanovs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated readme and example on calculator_tree
parent
6ad9d2b8
Pipeline
#528
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
README.md
README.md
+5
-1
calculator_tree.py
calculator_tree.py
+1
-1
No files found.
README.md
View file @
5ebd7983
To run tests:
`python test_calculator_tree.py`
Main code resides in
`tree_traversing.py`
Main function that can calculate the strings:
`calculate(string)`
\ No newline at end of file
Main function that can calculate the strings:
`calculate(string)`
e.g
`calculate(-4-7*3).calculate_below()`
will result in
`-25`
\ No newline at end of file
calculator_tree.py
View file @
5ebd7983
...
...
@@ -109,4 +109,4 @@ def calculate(expr, binary_tree=None):
if
__name__
==
"__main__"
:
expression
=
"-4-7*3"
print
(
calculate
(
expression
))
print
(
calculate
(
expression
)
.
calculate_below
()
)
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