#!/usr/bin/python

#Tyler Moore
#Solution to In-Class Exercise 2, Python notes
#2 Feb 2012

#only need this line if running independently of solution 1
from python_ex1_sol import state2PeaceYrs

state2Peace={}
for state in state2PeaceYrs:
    state2Peace[state]=state2PeaceYrs[state][-1]

above3states=[s for s in state2Peace if state2Peace[s]>=3]
below2states=[s for s in state2Peace if state2Peace[s]<=2]

newstates=[(s,state2Peace[s]) for s in state2Peace if s[:3]=="New"]
newstates #I guess there's nothing in a state being "New" that affects its peace index.
