use a range:
year = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] year[7..9] # => [2007, 2008, 2009] #two dots means "include both elements," and three dots means "don't include the last element."