Jupyter notebook assignments/Week2/quadratic_roots.ipynb
Kernel: Python 2 (SageMath)
In [3]:
Out[3]:
The smaller root of 1x^2 + 2x + 3 is:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-739f02b92059> in <module>()
36
37
---> 38 test(1, 2, 3)
39 test(2, 0, -10)
40 test(6, -3, 5)
<ipython-input-3-739f02b92059> in test(a, b, c)
33
34 print "The smaller root of " + str(a) + "x^2 + " + str(b) + "x + " + str(c) + " is:"
---> 35 print str(smaller_root(a, b, c))
36
37
TypeError: 'float' object is not callable
In [6]:
Out[6]:
The smaller root of 2x^2 +0x + -10is:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-6-730242505113> in <module>()
6
7
----> 8 test(2, 0, -10)
<ipython-input-6-730242505113> in test(a, b, c)
3
4 print"The smaller root of " +str(a) + "x^2 +" + str(b) +"x + " + str(c) + "is:"
----> 5 print str(smaller_root(a, b, c))
6
7
NameError: global name 'smaller_root' is not defined
In [ ]: