Create a function in Python that takes a list of numbers and returns the sum of all of the squared elements in the list.
[1, 2, 3, 4]
def sum_squares(nums): 
  total = 0
  for num in nums:
    total += num**2
  return total

print(sum_squares([1, 2, 3, 4])) 
# Output: 30