-
Notifications
You must be signed in to change notification settings - Fork 0
/
mytests.py
21 lines (18 loc) · 3.49 KB
/
mytests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# period = '202201'
# year = period[:-2]
# created_month = period[-2:]
# date_created = '{}-{}-01'.format(year, created_month)
# print("year:{} <=> month:{}".format(year, created_month))
# print(date_created)
# #https://hiskenya.org/api/analytics.json?dimension=dx%3AOePJt8CcZ0d%3BgMICOUtzqRb%3Blj9QYJqS7bN%3BYXJf27jfkvS%3BXiRbc0DSMOH%3BJiuqbydCIcy%3BpkShOkgNQt2%3BatSQz5O7e2A%3BgTkVw97FnQK%3BNOga2tabGrd%3BG7zACbrJMmY%3BYk5WVF4EQoX%3BTh97Ccd4BuJ%3Bdu5RMT3aecB%3Bwu0ITFRjUzF%3BD9YwtS6RhQ1%3BxMNhnyu7vm1%3BkLXGWRLzCAw%3BoCFXmpol7D8%3BF9OR49Lc1aR%3BcBTa1jVzT8f%3BJ4vNm7YEkdj%3BdlldM4hP2Wk%3BM5zablilTPO%3BEXmKDudsMNb%3BfuX0Qzg218I%3BfXErbzykgKz%3BkAvepmaQr9c%3BWOjriy3w7Fh%3BNYkr7LlxmUg%3BuSxBUWnagGg%3Bf9vesk5d4IY%3BETX9cUWF43c%3BmQz4DhBSv9V%3BLQpQQP3KnU1%3BPXUzSsmeY0P%3BoZc8MNc0nLZ%3BnwXS5vxrrr7%3Bhn3aChn4sVx%3BAfHArvGun12%3BhHLR1HP8xzI%3BKYpWTsp2yHv%3Bkk8BEq4Jlf7%3BmACm1JUzeLT%3BHbc2qRi0U5x%3Bjthpt5cVV9c%3BLC2OqnUC5Sn%3BDaNcGZnkclz%3ByWkSi8L3qGm%3BzNCSlBKbS6d%3BK59f8nZ5vhy%3BNv4OkbdDvmm%3BSCMKsiNj6c5%3BsEtNuNusKTT%3BtLrIZPv43Tk%3BPIxcR1T5ORh%3BSJL4k6Gl53C%3BwbJOu4h2SSz%3BGSEmLUnrvzj%3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3BDwUrEH0QR9t%3BIQDj4EXtjkt%3BwXXT8Tz7xDV%3BGrvJOYD3bjN%3BWTPcSOaXGq9%3BB5nvjZmEHdp%3BWC2ykyx4Xxg%3BIrYSkLRkyVD%3ByZi8q6XCExA%3BV5FjsLCNk8N%3BIDGEt81zZin%3BQv62ysRtBDq%3BCri80VT8NLG%3BymVyoLJ8yId%3BsfUb61y4eOl%3BriVaDMbSHNv%3BzK3uQzCz0yo%3BR8oYDOngoLk%3BDrNrgTebbHB%3BjZkIam58xet%3BbPQKfBFpNfA%3BWj1gBKsF1lB%3BMvevx0bAZh0%3BDRYHZsgOAjz%3BUeRIwewVX7n%3BlkXTcVtB8kE%3BxnQusGYwi6h%3BLXsaR9BQim1%3BTOXGRvz7S2W%3BoVqB8Da8cdy%3BjbufYjWV5II%3BbVBxAFZAt0P%3BO9btQp8H7N8%3BBRUzjqmNf3g%3BgvplllzYFPk%3BeZ7FsgXkAsT%3BLBDUxvoZSdI%3BDICdQoX6MX6%3BmKUPUA2Pk74%3BnjQvq4iZPb3%3BocD1WxIvGHT%3BKFY5g2xVY8j%3BssY2d9sMYGR%3BZEPXu4MCbVp%3BZhUKq5RvX0F%3BL7sSNQASLrY%3BcCERcsMGSDG&showHierarchy=true&hierarchyMeta=true&includeMetadataDetails=true&includeNumDen=true&skipRounding=false&completedOnly=false&outputIdScheme=UID&filter=pe%3A202403
def calculate_price_per_100(investment, interest_rate, days_to_maturity):
P = 100 * (1 / (1 + (interest_rate / 100 * days_to_maturity / 365)))
price = (P / 100) * investment
#price=price+(0.15*price)
return price
# Example values
investment = 300000
interest_rate = 15 # interest rate in percent
days_to_maturity = 91 # days to maturity
price = calculate_price_per_100(investment, interest_rate, days_to_maturity)
print(f"The price for an investment of {investment} at an interest rate of {interest_rate}% for {days_to_maturity} days is: {price:.2f} and a gain of {2*(investment-price)}")