Generate Python code to calculate the sum of the elements in a given list.
[1, 4, 8, 10]
list = [1,4,8,10]

def calculate_sum(list):
 sum = 0
 for number in list:
 sum += number
 return sum

sum = calculate_sum(list)
print(sum) # Output: 23