Hi Roelof,

On 6 September 2010 18:32, Roelof Wobben <rwob...@hotmail.com> wrote:

>        >>> index_of(5, (1, 2, 4, 5, 6, 10, 5, 5), 4)
>       6
>
> But in that tuple 5 is on position 3.
>
> Is the exercise here wrong ?
>
>

Not neccesarily...  I notice that the call is similar to the previous test
case, but has an extra parameter "4",  and that but that tuple that's being
searched contains other 5's.  If the extra parameter is interpreted as a
"starting index", then the next index of "5" starting at position 4, would
indeed be 6.  If my guesstimated intention of the test paramters is correct
then there's nothing wrong with the excercise/test and your implementation
of index_of needs to be enhanced to properly handle this extra parameter/new
test case.

Walter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to