Popular posts from this blog
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.
Python for Beginners : List_Part_1
In Python, there are four important built-in data types such as List, Set, Tuple and Dictionary. Lists are used to store more than one elements under a single variable name. Lists are mutable, means the elements in a List are changeable. Lists allow duplicate values. New items will be added at the end of the list.
Comments
Post a Comment