From b2859b7fdde15c28adcffc63173e63d2f85be27e Mon Sep 17 00:00:00 2001 From: Marina Date: Sat, 30 Mar 2024 16:15:31 +0100 Subject: [PATCH] sve sto imamo --- src/lib/lib.py | 12 +++--------- src/main.py | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/lib.py b/src/lib/lib.py index 7b54e36..2833c60 100644 --- a/src/lib/lib.py +++ b/src/lib/lib.py @@ -72,13 +72,6 @@ def __truediv__(self, b): return Div.simplify(self, b) @staticmethod def simplify(izraz): - - print(izraz.lista) - print(type(izraz)) - '''for el in izraz.lista: - print(el, type(el)) - el = Izraz.simplify(el) - print(el)''' return def __str__(self): @@ -486,7 +479,8 @@ def __str__(self): for term in self.lista: term_str = term.__str__() if term_str[0] != '-' and terms: - terms.append('**' + term_str) + terms.append(")**" + term_str) else: terms.append(term_str) - return "( " + ''.join(terms) + " )" \ No newline at end of file + + return "(" +''.join(terms) \ No newline at end of file diff --git a/src/main.py b/src/main.py index 4ce97a5..9373c53 100644 --- a/src/main.py +++ b/src/main.py @@ -3,5 +3,5 @@ x = Simbol("x") y = Simbol("y") -izraz = x*x - (x/x) + 1 +izraz = (x+1)*(x+2) print(izraz.expand())