Jun-16-2019, 05:52 PM
(Jun-16-2019, 05:42 PM)noisefloor Wrote: Hi,
@ppoyan89: iterating over an iterable withfor x in range(len(iterable))
is still a bad anti-pattern. Don't you have any motivation to use what you learned before?
Except this, this is solvable without iteration but by the build-in functionsorted
:
def is_sorted(iterable): return iterable == sorted(iterable)Regards, noisefloor
Hi!
I am not a very good programmer and had not a very good teacher! but at all cost I am trying to learn the base of programming... that is because I use this. It seems much more easier for me to write for example:
for i in range(len(a))
But you say it is a bad pattern for looping through a list ?