Updated deriver to python3

This commit is contained in:
madmaurice 2016-02-21 15:36:34 +01:00
parent b956e515b8
commit c420cd1e9b

View file

@ -310,7 +310,7 @@ class Simplifier:
if term.is_constant(): if term.is_constant():
return term.calc() return term.calc()
elif isinstance(term,Operator2): elif isinstance(term,Operator2):
print term.__class__.__name__ print ( term.__class__.__name__ )
sleft = Simplifier.simplify(term.left) sleft = Simplifier.simplify(term.left)
sright = Simplifier.simplify(term.right) sright = Simplifier.simplify(term.right)
@ -330,13 +330,13 @@ class Simplifier:
else: else:
return term return term
sterm = raw_input("Input term (deriving by x): ") sterm = input("Input term (deriving by x): ")
term = Parser.parse(sterm) term = Parser.parse(sterm)
print "Deriving %s" % term print ( "Deriving %s" % term )
dterm = Deriver.derive(term,"x") dterm = Deriver.derive(term,"x")
print "DTerm: %s" % dterm print ( "DTerm: %s" % dterm )
sterm = Simplifier.simplify(dterm) sterm = Simplifier.simplify(dterm)
print "Result: %s" % sterm print ( "Result: %s" % sterm )