simple question:the count of array

Alex Martelli aleaxit at yahoo.com
Tue Jul 31 09:16:37 EDT 2001


"sdf" <wqh-2 at 263.net> wrote in message
news:mailman.996583454.15942.python-list at python.org...
> >>> a=['a','b','c']
> >>> b=a.count()
> Traceback (most recent call last):
>   File "<pyshell#9>", line 1, in ?
>     b=a.count()
> TypeError: count() takes exactly 1 argument (0 given)
> >>>
>
> then how I get the number of a,I mean how much
> values in a,in this case it should be 3

len(a) is 3.


Alex






More information about the Python-list mailing list