I don't know why the shorter version isn't working for you.
I know the basic code fragment itself is fine.

I notice that your shorter version has four dashes rather
than the five in the longer version. Is that it? Other than that,
I suggest you use the debugger or just pile in prints to see
what's going on.

Reply via email to