Ive seen many tutorials on classes in python, but I'm trying to do something far more basic with them, but somehow it isnt working right.
I'm trying to make 3 dimensional points by putting them into the class's placeholder.
However when I try to print the output of make3Dpoint(x,y)
I get something like <__main__.point object at 0x02D8FA30>
.
When I try to append this output to a list I just get nonetype.
Obviously I'm a beginner to this and I don't want to get into any advanced way of solving this (and I'm not allowed to for the class this is for). I don't want to modify the class itself.
Is there anyway to make this output usable?
class point():
__slots__ = ('x','y','depth')
def calculate(x,y):
z = x * y + 2 * x * y + 4
return z
def make3Dpoint(x,y):
z = calculate(x,y)
point=point()
point.x = x
point.y = y
point.depth = z
return point