
March 30, 2017
12:23 p.m.
Le 30/03/17 à 19:06, Markus Meskanen a écrit :
And like I said before, for loop is just another way of doing while loop, yet nobody's complaining. There's nothing wrong with having two different ways of doing the same thing, as long as one of them is never the better way. If we add `repeat`, there's never a reason to use `for _ in range` anymore. It doesn't always creates something easier to use, like for example : `for _ in range(x, y, z)` (fixed or variable parameters) `for _ in one_list` (saves a call to len() with your solution) `for _ in any_other_kind_of_iterable` (we don't need to know the length here, we may even use a generator)