Horje
sort and reverse list in python Code Example
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)
python sort list in reverse
#1 Changes list
list.sort(reverse=True)
#2 Returns sorted list
sorted(list, reverse=True)
sort and reverse list in python
sort and reverse function
l=eval(input("enter"))
l.sort()
print(l)
l.reverse()
print(l)
#output
enter[1,2,3]
[1, 2, 3]
[3, 2, 1]
how to sort a list descending python
# defning A as a list
A.sort(reverse = True)




Python

Related
np argmin top n Code Example np argmin top n Code Example
pandas replace string with another string Code Example pandas replace string with another string Code Example
how to check whole number in python Code Example how to check whole number in python Code Example
plot using matplotlib Code Example plot using matplotlib Code Example
how to add a value to a list in python Code Example how to add a value to a list in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7