I wrote the following code and got the output:
a 13 0
None
b 81 3
None
c 8 2
None
d 9 2
None
e 1 1
None
where are those 'none' from? and how can I remove them?

class Point:
    def __init__(self,x,y,name):
        self.x = x
        self.y = y
        self.name = name
    def summary(self):
        print self.name,self.x,self.y
if __name__ == '__main__':
    from string import letters
    m = 13,81,8,9,1
    n = 0,3,2,2,1
    q=len(x)
    points = [ Point(m[i],n[i],letters[i]) for i in range(q) ]
    i=0
    while i<q:
        print points[i].summary()
        i=i+1

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to