input: Write a function to calculate the sum of all even numbers that are less than or equal to a given integer n. If the given integer n is less than 2, the function should return 0. The function should iterate through all even numbers from 2 to n, summing them up, and return the total sum.
  
  def sum_of_even_numbers(n):
   result = 0
   for i in range(2, n+1, 2):
    result += i
   return result
  
  assert sum_of_even_numbers(10)==30
  assert sum_of_even_numbers(2)==2
  assert sum_of_even_numbers(0)==0
  assert sum_of_even_numbers(1)==0
  assert sum_of_even_numbers(100)==2550
output: def sum_of_even_numbers(n):
   result = 0
   for i in range(2, n+1, 2):
    result += i
   return result