[Python-ideas] Way to repeat other than "for _ in range(x)"

Pavol Lisy pavol.lisy at gmail.com
Thu Mar 30 14:49:29 EDT 2017


On 3/30/17, Joshua Morton <joshua.morton13 at gmail.com> wrote:

>    def repeat_for(func, iters):
>         return func() for _ in range(iters)
>
> does what you want without any required syntax changes.

I've got a "SyntaxError: invalid syntax"

PL.


More information about the Python-ideas mailing list