We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 90df653 + c5c2fa3 commit adc008fCopy full SHA for adc008f
SelectionSort.py
@@ -1,14 +1,20 @@
1
-print ("Enter numbers seprated by comma ")
2
def selectionsort( aList ):
3
for i in range( len( aList ) ):
4
least = i
5
for k in range( i + 1 , len( aList ) ):
6
if aList[k] < aList[least]:
7
least = k
8
9
- swap( aList, least, i )
+ aList = swap( aList, least, i )
+ print(aList)
10
11
def swap( A, x, y ):
12
tmp = A[x]
13
A[x] = A[y]
14
A[y] = tmp
15
+ return A
16
+
17
+print ("Enter numbers seprated by comma ")
18
+response = input()
19
+aList = list(response.split(','))
20
+selectionsort(aList)
0 commit comments