How to call functions/methods inside objects in python
<p>Here is my code.</p>

<p>How do I execute the print_point line? <strong>Edited to work. Thank you</strong></p>

<pre><code>class Point:
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y

    def distance_from_origin(self):
        return ((self.x **2) + (self.y **2)) **.5
    def print_point(p):
        print '(%s, %s)' % (str(p.x), str(p.y))
</code></pre>

<p>Here is what I type into the shell after running module:</p>

<pre><code>p = Point(5,2)

p.x

    5

p.y

    2

p.distance_from_origin()

    5.385164807134504

p.print_point(p)

    Traceback (most recent call last):
    File "&lt;pyshell#196&gt;", line 1, in &lt;module&gt;
    p.print_point(p)
    TypeError: print_point() takes exactly 1 argument (2 given)
</code></pre>
