License Public Domain
Lines 5
Implements this Algorithm
Permissions
Owner: lolyzor
Viewable by Everyone
Editable by All Siafoo Users
Hide
Easily highlight source code for your blog with our Syntax Highlighter. Join Siafoo Now or Learn More

Efficient Python implementation Atom Feed 1

In Brief Real code trolling :D, note the generator expression combined with built in function any(), it will return after the first miss match.
# 's
1import random
2a = [random.randrange(1,10) for x in range(1,10)]
3b,a = a,sorted(a)
4while any((s1!=s2 for s1,s2 in zip(a,b))):
5 random.shuffle(b)

Real code trolling :D, note the generator expression combined with built in function any(), it will return after the first miss match.