input: Write a python function named 'count_vowels' that accepts a string representing a word and calculates the total number of vowels within the string. For this function, vowels include 'a', 'e', 'i', 'o', 'u', and 'y' when it appears at the end of the input word.
  assert count_vowels("abcde") == 2
  assert count_vowels("Alone") == 3
  assert count_vowels("key") == 2
  assert count_vowels("bye") == 1
  assert count_vowels("keY") == 2
  assert count_vowels("bYe") == 1
  assert count_vowels("ACEDY") == 3
output: def count_vowels(word):
      word = word.lower()
      vowels = 'aeiou'
      total_vowels = sum(1 for char in word if char in vowels)
      if word.endswith('y'):
          total_vowels += 1
      return total_vowels