Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Nov 29, 2020
Embed
What would you like to do?
a = [34, 56, 32, 89, 65, 54]
for i in range(len(a)):
index = i
for j in range(i+1, len(a)):
if a[index] > a[j]:
index = j
a[i], a[index] = a[index], a[i]
print("Sorted Array using Selection sort algorithm : ")
for i in range(len(a)):
print(a[i])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment