Advertisement
MarceloJunior

Ordenação

Apr 11th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. a = ['Marcelo','Arthur Di Blasio','Ronaldo', 'Paulo', 'Arthur','Gugi', 'Bruno', 'Junior', 'Caio', 'Lucas',]
  2.  
  3. ordena = True
  4.  
  5. while(ordena):
  6.     ordena = False
  7.     for i in range(len(a)-1):
  8.         if a[i] > a[i+1]:
  9.             aux = a[i]
  10.             a[i] = a[i+1]
  11.             a[i+1] = aux
  12.             ordena = True
  13.             pass
  14.         pass
  15. print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement