Last active
November 11, 2017 03:29
-
-
Save kanzitelli/04c52960e3e1d0bdf029708989a8abdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AAPL_p_01_01_2016 = 5000 | |
number_of_shares_start = math.floor(AAPL_p_01_01_2016 / close_prices_2016.AAPL[0]) | |
AAPL_p_12_31_2016 = number_of_shares_start * close_prices_2016.AAPL[-1] | |
print "1. Relative return for Apple = %.2f%%" % ( (AAPL_p_12_31_2016 - AAPL_p_01_01_2016) / AAPL_p_01_01_2016 * 100 ) | |
AMZN_p_01_01_2016 = 5000 | |
number_of_shares_start = math.floor(AMZN_p_01_01_2016 / close_prices_2016.AMZN[0]) | |
AMZN_p_12_31_2016 = number_of_shares_start * close_prices_2016.AMZN[-1] | |
print "2. Relative return for Amazon = %.2f%%" % ( (AMZN_p_12_31_2016 - AMZN_p_01_01_2016) / AMZN_p_01_01_2016 * 100 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment