[Tutor] function error
nitin.162 at gmail.com
Tue Sep 28 12:35:27 CEST 2010
It seems that ur turtle.position doesn't return a list because of this when
indexing is done on that u get this kind of error.
On Tue, Sep 28, 2010 at 3:39 PM, Alan Gauld <alan.gauld at btinternet.com>wrote:
> "roberto" <roberto03 at gmail.com> wrote
> i have the following error when i call this function:
>> 20 def outOfBounds():
>> ---> 21 if abs(turtle.position()) >
>> turtle.window_height()/2 or abs(turtle.position()) >
>> 22 return "true"
>> 23 else:
>> TypeError: 'function' object is unsubscriptable
>> but i can't really figure out where is the problem with this function
> This means you are trying to use  on a function.
> eg you might be doing turtle.position instead of turtle.position()
> I can't see it in your code sample but I'd check carefully that your
> parens() all balance correctly and are in the right place...
> Alan Gauld
> Author of the Learn to Program web site
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor