Dongsheng Ruan a écrit :
> I got feed back saying" list object is not callable". But I can't figure out 
> what is wrong with my code.
 >
> A=[3,5,4,9,6,7]
> l=len(A)-1
> 
> for i in range(l):
>      print A(i) 
> 
The error message is quite clear when you remember that () is the call 
operator. For the subscribe operator, you want [].

And FWIW, Python for loops are smarter than that:


A = [3,5,4,9,6,7]
for i in A:
   print i


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

Reply via email to