Operation On Dictionary In Python Get Function