List
Common List Operations
List examples using functions
>>> list1 = [2, 3, 4, 1, 32]
>>> 2 in list1
# True
>>> 33 not in list1
# True
>>> len(list1) # find the number of elements in the list
# 5
>>> max(list1) # find the largest element in the list
# 32
>>> min(list1) # find the smallest element in the list
# 1
>>> sum(list1) # sum of elements in the list
# 42List slicing
+ and * operators in list
+ and * operators in listin or not in operator
in or not in operatorTraversing list using for loop
List Comprehension
Commonly used list methods with return type
Last updated