Created
January 7, 2020 18:51
-
-
Save blackrobot/52471d02bcdd266b6bac9e4792596439 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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Hourly Rate Calculator\n", | |
"\n", | |
"Use your annual salary to calculate how much you should charge hourly to make up for lost benefits and salary." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from decimal import Decimal as D\n", | |
"\n", | |
"TAXES = D('0.08')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# Normally the company's portion of your health insurance and\n", | |
"# other benefits\n", | |
"annual_benefits = D('300.00') * 12\n", | |
"\n", | |
"# Your annual salary\n", | |
"annual_salary = D('100_000.00')\n", | |
"\n", | |
"# Estimated hours per year\n", | |
"vacation_weeks = 2\n", | |
"annual_hours = (\n", | |
" 50 # Weeks worked per year minus vacation weeks\n", | |
" * 5 # Work days per week\n", | |
" * 8 # Work hours per day\n", | |
")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"estimated_hourly_rate = round(\n", | |
" (annual_salary + annual_benefits)\n", | |
" / annual_hours\n", | |
" * (1 + TAXES),\n", | |
" ndigits=2,\n", | |
")" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment