programming tip

Pass list items as arguments

In Python, you can pass the elements of a list as individual parameters without specifying it manually by index using the * operator. This is also known as unpacking.

l = [5, 6]
def sum(x, y):
    print(x + y)

sum(*l)