input: Write a function to determine if the specified number exhibits an undulating pattern.
  assert is_undulating("1212121") == True
  assert is_undulating("1991") == False
  assert is_undulating("121") == True
output: def is_undulating(number):
      if len(number) < 3:
          return False
      a, b = number[0], number[1]
      if a == b:
          return False
      for i in range(2, len(number)):
          if (i % 2 == 0 and number[i] != a) or (i % 2 != 0 and number[i] != b):
              return False
      return True