Jun-16-2019, 05:42 PM
(This post was last modified: Jun-16-2019, 05:43 PM by noisefloor.)
Hi,
@ppoyan89: iterating over an iterable with
Except this, this is solvable without iteration but by the build-in function
@ppoyan89: iterating over an iterable with
for 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 function
sorted
:def is_sorted(iterable): return iterable == sorted(iterable)Regards, noisefloor