input: Write a function to calculate the sum of all even numbers less than or equal to n. The function should take a single integer n as input and return the sum of all even numbers from 2 to n. If n is less than 2, the function should return 0.
  
  assert sum_of_even_numbers(10)==30
  assert sum_of_even_numbers(5)==6
  assert sum_of_even_numbers(2)==2
  assert sum_of_even_numbers(1)==0
  assert sum_of_even_numbers(0)==0
output: def sum_of_even_numbers(n):
      if n < 2:
          return 0
      return sum(i for i in range(2, n + 1, 2))