Skip to content

Commit 5d25359

Browse files
committed
Work completed
1 parent cdf6d4b commit 5d25359

24 files changed

+8571
-9
lines changed

Work/Data/stocklog.csv

Lines changed: 7945 additions & 0 deletions
Large diffs are not rendered by default.

Work/bounce.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
# bounce.py
22
#
33
# Exercise 1.5
4+
height = 100 # Meters
5+
bounce_back = 3/5
6+
bounces = 1
7+
8+
while bounces <= 10:
9+
next_height = height * bounce_back
10+
print(bounces, round(next_height, 4))
11+
height = next_height
12+
bounces += 1
13+

Work/fileparse.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

Work/formatting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
print()
2+
print('{:^10s} {:^10s} {:^10s}'.format('Name', 'Shares', 'Price'))
3+
print('-'*10 + ' ' + '-'*10 + ' ' + '-'*10)
4+
5+
print('-'*10)
6+
input('|')
7+
print('-'*10)

Work/mortgage.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
# mortgage.py
22
#
33
# Exercise 1.7
4+
5+
principal = 500000.0
6+
rate = 0.05
7+
payment = 2684.11
8+
total_paid = 0.0
9+
month = 0
10+
11+
extra_payment_start_month = int(input('Start Month: '))
12+
extra_payment_end_month = int(input('End Month: '))
13+
extra_payment = int(input('Payment Extra: '))
14+
15+
while principal > 0:
16+
if month >= extra_payment_start_month and month < extra_payment_end_month:
17+
extra = extra_payment
18+
else:
19+
extra = 0
20+
principal = (principal * (1+rate/12) - payment) - extra
21+
total_paid = (total_paid + payment) + extra
22+
month += 1
23+
print(round(month, 2), round(total_paid, 2),
24+
round(principal, 2) if principal > 0 else 0)
25+
26+
print()
27+
print(f'Total paid: {total_paid:0.2f}')
28+
print(f'Months: {month:>7d}')

Work/pcost.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

Work/porty-app/MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# MANIFEST.in
2+
include *.csv

Work/porty-app/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Porty #
2+
3+
Package for manage portfolios and prices.
4+
5+
# License
6+
7+
Porty: Package for manage portfolios and prices
8+
Copyright © 2020 lhel
9+
10+
Permission is hereby granted, free of charge, to any person obtaining
11+
a copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
26+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+

Work/porty-app/portfolio.csv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name,shares,price
2+
"AA",100,32.20
3+
"IBM",50,91.10
4+
"CAT",150,83.44
5+
"MSFT",200,51.23
6+
"GE",95,40.37
7+
"MSFT",50,65.10
8+
"IBM",100,70.44

Work/porty-app/porty/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
porty
4+
~~~~~~~~~~~~~~
5+
6+
Package for manage portfolios and prices.
7+
8+
:copyright: (c) 2020 by lhel.
9+
:license: MIT, see LICENSE for more details.
10+
"""
11+

0 commit comments

Comments
 (0)