Created
January 28, 2015 09:20
-
-
Save lrvick/dedee83bae51f062e9fb to your computer and use it in GitHub Desktop.
Python Happiness Calculator. (Don't ask)
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
present_happiness = 1 | |
trauma_happiness = present_happiness/10 | |
post_trauma_happiness = present_happiness*2 | |
trauma_years = 1 | |
years_left = 43 | |
def calculate_happiness(procrastination_days): | |
total_days = years_left * 365 | |
trauma_days = trauma_years * 365 | |
post_trauma_days = (total_days - trauma_days - procrastination_days) | |
a = procrastination_days * present_happiness | |
b = trauma_days * trauma_happiness | |
c = post_trauma_days * post_trauma_happiness | |
return ( a + b + c ) | |
def display_happiness_loss(procrastination_days): | |
optimal_happiness = calculate_happiness(1) | |
happiness_loss = optimal_happiness - \ | |
calculate_happiness(procrastination_days) | |
print('happiness loss - procrastinate %s days: %s' \ | |
% (procrastination_days, happiness_loss)) | |
display_happiness_loss(1) | |
display_happiness_loss(60) | |
display_happiness_loss(365) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment