You are given the following data dictionary: firm_dict = { 'name': 'XR Corp.', 'revenue': 8.649, 'operating income': 3.0
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
You are given the following data dictionary: firm_dict = { 'name': 'XR Corp.', 'revenue': 8.649, 'operating income': 3.0
You are given the following data dictionary: firm_dict = { 'name': 'XR Corp.', 'revenue': 8.649, 'operating income': 3.027, 'net income': 2.162 } Write the code to return the value for the operating income of the firm, and return 0 if the key does not exist. (Make sure you are using single quotation marks in your answer, like in the question.) 0 Submit Wrong Answer You want to compute the net profit margin of firm XR. Use the dictionary firm_dict by copying it into your Jupyter notebook. Which of the following commands will compute the net profit margin, defined as the net income divided by the revenue? 1. firm_dict ['revenue']/firm_dict ['net_income'] 2. firm_dict ['net_income']/firm_dict ['revenue'] 3. firm_dict['net income']/firm_dict ['revenue'] 4. firm_dict.revenue/firm_dict.net_income type your answer here Submit