# point_tutor.py
# Walker M. White (wmw2)
# September 7, 2014
"""Code to show off object in the Python tutor
Copy and past the following code into the tutor."""
### IGNORE THIS PART FOR NOW
class Point(object):
def __init__(self,x,y,z):
self.x = float(x)
self.y = float(y)
self.z = float(z)
### YOU CAN STOP IGNORING NOW
def incr_x(q):
"""Increments the x coord of p by 1
Precondition: p is a Point object"""
q.x = q.x+1
def copy2d(p):
"""Makes a 2d copy of the point p
Precondition: p is a Point object"""
# Make a new point
q = tuple3d.Point(p.x,p.y,0)
return q
p = Point(1,2,3)
q = p
incr_x(p)