Created
September 5, 2016 10:58
-
-
Save ooade/d52ed55d662814bf1a0d7d2358f3443a to your computer and use it in GitHub Desktop.
Python Classes ctn'd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point3D(object): | |
def __init__(self, x, y, z): | |
self.x = x | |
self.y = y | |
self.z = z | |
def __repr__(self): | |
return "(%d, %d, %d)" % (self.x, self.y, self.z) | |
my_point = Point3D(1, 2, 3) | |
print my_point |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment