On Feb 5, 2016 12:07 AM, "noopy via Tutor" <tutor@python.org> wrote:
>
> Hi,
>
> I just cannot get my head around the following code, maybe someone could
explain it to me.
>
> def permutations(items):

When trying to understand a function (or in this case, a generator),
knowing the types of input and output can be helpful.  Also, knowing some
sample outputs for small inputs is also important.

Without even looking at the implementation, can you say in words what this
function is intended to do? What's the type of the input?  What's the type
of the output? And can you give a few concrete examples of what you'd like
it to do on "small" inputs?

(Trying to demonstrate a general problem strategy that works surprisingly
well, and that we actually use in practice.)
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to