Python for Beginners : List_Part_4
Other methods :
len(listname) - returns the number of elements a list has.
max(listname) - returns the maximum value from a list.
min(listname) - returns the minimum value from a list.
listname.count(element) - returns the number of occurrence of an element in a list.
listname.index(element) - returns the index (position) of an element.
listname.reverse() - reverses the order of elements in a list.
listname.sort() - arranges the elements of a list in ascending order.
listname.sort(reverse = True) - arranges the elements of a list in descending order.
Comments
Post a Comment