Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L = [1, 2, 3, 4, 5]
- fin = 5
- while fin > 1:
- cambio = False
- x = 0
- while x < (fin - 1):
- if L[x] > L[x+1]:
- cambio = True
- #Variable Auxiliar
- temp = L[x]
- L[x] = L[x+1]
- L[x+1] = temp
- x+=1
- if not cambio:
- break
- fin -= 1
- for e in L:
- print(e)
- ## En este caso todo va a ser falso ya que la Lista esta ordenada
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement