Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ def __init__(self):
def err(self):
self.error = True

def eval_function(self, x: str): -> float
def eval_function(self, x: str) -> float:
"""
evaluates x to return a result
"""
print(eval(x))
return eval(x)


Expand Down
Empty file added empty_file
Empty file.
5 changes: 3 additions & 2 deletions main_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def screen_options():
elif Operation == 20:
print("Evaluate")
x = str(input("Enter what you would like evaluated: "))
return calc.eval_function(x)
calc.result = calc.eval_function(x)
return calc.result

elif Operation == 21:
condi = False
Expand All @@ -249,7 +250,7 @@ def choose_data_type():
print(bin(int(calc.result)).replace("0b", ""))
return bin(int(calc.result)).replace("0b", "")
elif type_choice == 4:
print(oct(int(calc.resultt)))
print(oct(int(calc.result)))
return oct(int(calc.result))


Expand Down