output question 1

leewang kim leewang.kim at gmail.com
Thu Nov 10 05:38:02 EST 2005


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 <http://self.name> = name
def summary(self):
print self.name <http://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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051110/fca5822f/attachment.html>


More information about the Python-list mailing list