List Functions

Built-in functions
Get the number of elements in a list
len(your_list)
Find the sum of a list
sum(your_list)
Find the minimum value of a list
min(your_list)
Find the maximum value of a list
max(your_list)
Random library methods
Choose a random element from a list
import random
random.choice(your_list)
Shuffle a list
import random
random.shuffle(your_list)
List methods
Sort a list
your_list.sort()
Reverse a list
your_list.reverse()
Remove all elements from a list
your_list.clear()
Last section Next section