listofnames = nameofsender[0], listofnames

does not add a name to a list.  Rather it creates a tuple of the new
name and the list and then binds the tuple to the list name.  That's why
you wind up with the lisp style list.

To add a name to the head of the list use
        listofnames.insert(0, nameofsender[0])


If you are using a version of Python that supports sets, using sets
would be much simpler since the duplicates get discarded automatically.

import sets     # python2.3
setofnames = sets.Set()
while.....
        setofnames.add(nameofsender[0])
....
len(setofnames)         # count of distinct names

-- 
Lloyd Kvam
Venix Corp

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to