Skip to content

Instantly share code, notes, and snippets.

@aambrioso1
Created August 26, 2019 04:01
Show Gist options
  • Save aambrioso1/1a8d16e3462a788fdc4de67b043f1f3c to your computer and use it in GitHub Desktop.
Save aambrioso1/1a8d16e3462a788fdc4de67b043f1f3c to your computer and use it in GitHub Desktop.
recycle.py
e=1
f=9
c=3
def drinks(e,f,c):
total = 0
while((e + f) >= c): # Do we have enough empties?
d = (e + f)//c # How many can Tom buy?
left = (e + f) % c # How many leftover?
total += d # How many did Ton drink this time?
e = d # More empty bottle
f = left
return total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment