Python lets you do if/else assignment, so you don't need to repeat registration_status[JSON_RC]:

registration_status[JSON_RC] = result_code if result_code == DIAMETER_SUCCESS else exp_result_code