I just started using python a week ago although I have some background in C++. I\'m just making some simple user defined functions. Code is below.
def quad
Like David Robinson said in his comment, I think the function will run correctly if you enter
quadratic.quads()
This runs it as a function, as all functions have the two parentheses. Without it, it would be considered a variable in a class.
You need to use ()
to call the function.
Here's a simple test example of defining a trivial function and then calling it using use the name and then the name with ()
to illustrate the difference:
Python 2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def my_func():
... print "yo!"
...
>>> my_func
<function my_func at 0x7f3c84c74578>
>>> my_func()
yo!
>>>