Last active
October 8, 2018 20:34
-
-
Save emarte91/64d86d964490f9a08e17af4581cb6f6c to your computer and use it in GitHub Desktop.
Calculates weekly, biweekly, and monthly salary only for 2 states. AZ and NY
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
def calculations(): | |
salary = int(input("What is your yearly salary?")) | |
state = input("What state are you in? Choose a number \n 1: AZ \n 2: NY\n:") | |
states = {'1': .83, '2': .73} | |
state_tax = states.get(state) | |
weekly = int((salary / 52) * state_tax) | |
monthly = int((salary / 12) * state_tax) | |
biweekly = weekly * 2 | |
print("Weekly: $" + str(weekly) + "\nMonthly: $" + str(monthly) + "\nBiWeekly: $" + str(biweekly)) | |
new_calculation = input("Would you like to calculate another salary? Y/N:") | |
if new_calculation == 'y' or new_calculation == 'Y': | |
restart() | |
else: | |
exit | |
def restart(): | |
calculations() | |
calculations() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment