There's a nifty dictionary function called setdefault() that will essentially let you do this if statement in one line. :)