From 2c34c895faea65ac64ad33f807ed6aada9a901fc Mon Sep 17 00:00:00 2001 From: fynik <66061688+fynik@users.noreply.github.com> Date: Mon, 1 Jun 2020 00:01:51 +0600 Subject: [PATCH 1/3] done --- Work/bounce.py | 9 +++++++++ Work/sears.py | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Work/sears.py diff --git a/Work/bounce.py b/Work/bounce.py index 3660ddd82..97e5b4446 100644 --- a/Work/bounce.py +++ b/Work/bounce.py @@ -1,3 +1,12 @@ # bounce.py # # Exercise 1.5 + +height = 100 #meters +bounce_count = 10 +i = 1 + +while i <= bounce_count: + height *= 0.6 + i += 1 + print(round(height, 4)) \ No newline at end of file diff --git a/Work/sears.py b/Work/sears.py new file mode 100644 index 000000000..7a28bf15d --- /dev/null +++ b/Work/sears.py @@ -0,0 +1,11 @@ +bill_thickness = 0.11 * 0.001 # Meters (0.11 mm) +sears_height = 442 # Height (meters) + +bill_count = 1 +day = 1 + +while bill_count * bill_thickness <= sears_height: + day += 1 + bill_count *= 2 + +print(f'Number of bills: {bill_count}, overall height: {bill_count*bill_thickness}, days : {day}') From 0aa736f085849bcdc43885ead86a116d98edb013 Mon Sep 17 00:00:00 2001 From: fynik <66061688+fynik@users.noreply.github.com> Date: Mon, 1 Jun 2020 21:40:30 +0600 Subject: [PATCH 2/3] one more --- Work/mortgage.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Work/mortgage.py b/Work/mortgage.py index d527314e3..1604c2a6b 100644 --- a/Work/mortgage.py +++ b/Work/mortgage.py @@ -1,3 +1,14 @@ # mortgage.py # # Exercise 1.7 + +principal = 500000.0 +rate = 0.05 +payment = 2684.11 +total_paid = 0.0 + +while principal > 0: + principal = principal * (1+rate/12) - payment + total_paid = total_paid + payment + +print('Total paid', total_paid) From 59b3c1ef63fe017a636fc9c43423f44917509a5d Mon Sep 17 00:00:00 2001 From: Anton Shlain Date: Sun, 21 Jun 2020 23:55:53 +0600 Subject: [PATCH 3/3] changes to gitignore --- .gitignore | 130 +---------------------------------------------------- 1 file changed, 1 insertion(+), 129 deletions(-) diff --git a/.gitignore b/.gitignore index b6e47617d..600d2d33b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,129 +1 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ +.vscode \ No newline at end of file