Mapping Function In Dictionary In Python