Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Epic
#python 2.7.12 print "Hello, world!" list = [3, 1, 16, 14, 18, 5] # we keep sorting until we reach the end of the list for i in xrange(len(list)): minimum = i # find a number stored smaller than the minimum for j in xrange(i + 1, len(list)): # if we find a smaller one, store that to the minimum if(list[j] < list[minimum]): minimum = j #swap the new one we found with the number at the front temp = list[i] list[i] = list[minimum] list[minimum] = temp """selection sort""" import random list = [] for k in xrange(0,10): num = random.randint(1,100) list.append(num) print(list) print(" ")
run
|
edit
|
history
|
help
0
MPS encoding
0dd08b977895229d09b4848e467a4e10162ed345de0b245922b3505909d33ead
PyClass2
PyPropertyDecorator
Aufgabe 15
Python regex to find repetitive word count
GayChicken
0aa6d60d0504c8470fc90c1d5cbf06083cdaadeab6e102bf90732ac2ab66dfdc
Lambda
asd