how sum function works in python code example Example: python sum x = [1,2,3,4,5] s = sum(x) print(s) # 15