end of project

This commit is contained in:
2025-08-15 16:14:02 +02:00
parent 495935dc74
commit d6ab65d7cf
10 changed files with 278 additions and 41 deletions

View File

@@ -1,22 +1 @@
import sys
from pkg.calculator import Calculator
from pkg.render import render
def main():
calculator = Calculator()
if len(sys.argv) <= 1:
print("Calculator App")
print("Usage: python main.py \"<expression>\"")
print("Example: python main.py \"3 + 5\"")
return
expression = " ".join(sys.argv[1:])
try:
result = calculator.evaluate(expression)
to_print = render(expression, result)
print(to_print)
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()
print(3 + 7 * 2)