financial_analyzer.roi

Module Contents

Functions

roi(initial_investment, current_value)

Calculate the Return on Investment (ROI).

financial_analyzer.roi.roi(initial_investment, current_value)[source]

Calculate the Return on Investment (ROI).

Parameters:
  • initial_investment ({float, int}) – The initial amount invested.

  • current_value ({float, int}) – The current value of the investment.

Returns:

float

Return type:

The ROI expressed as a percentage.

Examples

Context: You are selling paintings, your initial investment is 1,000,000 dollars. 2 months later, the value of your initial investment grew to 1,200,000 dollars, what is your return on investment? >>> initial_investment = 1000000 >>> current_value = 1200000 >>> roi = roi(initial_investment, current_value) >>> print(f”The roi of your ivestment is {roi} %”) The roi of your ivestment is 20%