fruit = ["Banana","Apple","Mango","Pineapple","Passionfruit","Figs","Appricots"]
for count1 in range(len(fruit)-1):
for count2 in range(len(fruit)-1):
if ( fruit[count2] > fruit[count2+1] ):
tmp = fruit[count2]
fruit[count2] = fruit[count2+1]
fruit[count2+1] = tmp
print fruit
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment