List sort( ) Method
The sort() method sorts objects of list, use compare function if given.
Syntax
list.sort([func])
|
Return Value
This method does not return any value but reverses the
given object from the list.
Example
#!/usr/bin/python3
list1.sort()
print
("list now : ", list1)
|
When we run the above program, it produces the
following result
list
now : ['Biology', 'chemistry', 'maths', 'physics']
|
<<< reverse( ) Go to Index Tuples >>>