def has_variety(seq):
 for (i, s) in enumerate(seq):
  if (i == 0):
   sentinel = s
  elif (s != sentinel):
   return True
 return False

def has_variety ( seq ) : for ( i , s ) in enumerate ( seq ) : if ( i == 0 ) : sentinel = s elif ( s != sentinel ) : return True return False
return true if there are any different elements in seq .