Skip to content

Instantly share code, notes, and snippets.

@Arinerron
Created November 17, 2021 01:09
Show Gist options
  • Save Arinerron/11ab2f4a268c8db2b420760f63a4cf20 to your computer and use it in GitHub Desktop.
Save Arinerron/11ab2f4a268c8db2b420760f63a4cf20 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
BOTTLES_PER_MONTH_PER_STUDENT = 156 / 12 # https://www.jerseyislandholidays.com/plastic-bottle-pollution-statistics
BOTTLE_PERCENT_PLASTIC = 0.291 # https://www.epa.gov/facts-and-figures-about-materials-waste-and-recycling/plastics-material-specific-data
BOTTLE_PERCENT_RECYCLED = 0.09 # https://www.greenmatters.com/p/what-percent-recycling-actually-gets-recycled
AVERAGE_PLASTIC_GRAMS_PER_BOTTLE = 19 # https://www.wastecare.com/usefulinfo/PET-Plastic-Water-Soda-Bottles-Bale-Weights.htm
AVERAGE_PLASTIC_GRAMS_PER_ID = 5 # https://www.uscreditcardguide.com/the-most-heavy-credit-cards-list/
while True:
try:
num_students = int(input('Number of students at school: '))
assert num_students > 0
num_months = int(input('How often you want us to produce cards (in months): '))
assert num_months > 0
except (ValueError, AssertionError):
print('Input must be an integer greater than 0')
exit(1)
except KeyboardInterrupt:
print('Goodbye!')
exit(0)
total_bottles = BOTTLES_PER_MONTH_PER_STUDENT * num_students * num_months * BOTTLE_PERCENT_PLASTIC
num_recycled_bottles = total_bottles * BOTTLE_PERCENT_RECYCLED
amount_plastic_recycled = num_recycled_bottles * AVERAGE_PLASTIC_GRAMS_PER_BOTTLE
print('------')
print('Number of grams of recycleable waste plastic over %d months: %dkg' % (num_months, amount_plastic_recycled // 1000))
num_ids = amount_plastic_recycled // AVERAGE_PLASTIC_GRAMS_PER_ID
print('Number of ID cards we could produce: %d cards' % num_ids)
print('Contact sales if your school would be interested in doing business with us!\n\n====================\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment