Answers for "list sorted function reverse python"

7

python sort list in reverse order

# there are two types of lists
# returns new list
sorted(list_name, reverse=True)

# changes list in place
list_name.sort(reverse=True)
Posted by: Guest on January-30-2021
1

list reverse method in python

l1 = [1, 8, 7, 2, 21, 15]

 l1.reverse() # reverses the list
  
  print(l1)
  
  #it will reverse the list
Posted by: Guest on January-12-2022

Python Answers by Framework

Browse Popular Code Answers by Language