Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, December 3, 2012

Codecademy: Building Useful Classes


#sample solution


class Point3D(object):
def __init__(self,x,y,z):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return "(%s, %s, %s)" % (self.x,self.y,self.z)

myPoint = Point3D(1,2,3)
print myPoint

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts