delucaspinto

List inverted

Jul 30th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. L = [3, 2, 1, 4, 5]
  2. #L = sorted(L)
  3.  
  4. #lista normal
  5. print(L)
  6. #inverter lista
  7. print(L[::-1])
  8.  
  9. L.sort(reverse=True)
  10. print(L)
Advertisement
Add Comment
Please, Sign In to add comment