sorting of a list
def sort():
a=[2,5,4,9,11,7]
print("list before sorting is:")
print(a)
for i in a:
for j in range(i+1,len(a)):
if a[i]<a[j]:
temp=a[i]+a[j]
a[i]=temp-a[i]
a[j]=temp-a[j]
print ("list after sorting is:")
print a
how can we write a sorted array list.is this code is correct.please send me a correct code
a=[2,5,4,9,11,7]
print("list before sorting is:")
print(a)
for i in a:
for j in range(i+1,len(a)):
if a[i]<a[j]:
temp=a[i]+a[j]
a[i]=temp-a[i]
a[j]=temp-a[j]
print ("list after sorting is:")
print a
how can we write a sorted array list.is this code is correct.please send me a correct code

