Skip to content

Commit

Permalink
sve sto imamo
Browse files Browse the repository at this point in the history
  • Loading branch information
sstojilkovic19 committed Mar 30, 2024
1 parent 8224754 commit b2859b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/lib/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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) + " )"

return "(" +''.join(terms)
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
x = Simbol("x")
y = Simbol("y")

izraz = x*x - (x/x) + 1
izraz = (x+1)*(x+2)
print(izraz.expand())

0 comments on commit b2859b7

Please sign in to comment.