man
New member
- Joined
- Sep 16, 2009
- Messages
- 330
- MBTI Type
- IntP
- Enneagram
- =)
Code:
import random
def mansort(x):
while not sorted?(x):
random.shuffle(x)
return x
def sorted?(x):
if not x:
return True
last = x[0]
for y in x[1:]:
if y < last:
return False
last = y
return True
constructive criticism appreciated