kyu_7.share_prices package
Submodules
kyu_7.share_prices.share_price module
Solution for -> Share prices.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_7.share_prices.share_price.share_price(invested: int, changes: list) → str[source]
Share prices function.
Calculates, and returns the current price of your share, given the following two arguments:
1. invested(number), the amount of money you initially invested in the given share 2. changes(array of numbers), contains your shares daily movement percentages
The returned number, should be in string format, and it’s precision should be fixed at 2 decimal numbers. :param invested: int :param changes: list :return: str
kyu_7.share_prices.test_share_price module
Test for -> Share prices.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_7.share_prices.test_share_price.SharePriceTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting share_price function.
- _classSetupFailed = False
- _class_cleanups = []
- test_share_price = None
- test_share_price_0(**kw)
Testing share_price function with multiple test inputs [with invested=100, changes=[], expected=’100.00’].
- Returns:
- test_share_price_1(**kw)
Testing share_price function with multiple test inputs [with invested=100, changes=[-50, 50], expected=’75.00’].
- Returns:
- test_share_price_2(**kw)
Testing share_price function with multiple test inputs [with invested=100, changes=[-50, 100], expected=’100.00’].
- Returns:
- test_share_price_3(**kw)
Testing share_price function with multiple test inputs [with invested=100, changes=[-20, 30], expected=’104.00’].
- Returns:
- test_share_price_4(**kw)
Testing share_price function with multiple test inputs [with invested=1000, changes=[0, 2, 3, 6], expected=’1113.64’].
- Returns:
Module contents
Share price.