Created
August 26, 2019 04:01
-
-
Save aambrioso1/1a8d16e3462a788fdc4de67b043f1f3c to your computer and use it in GitHub Desktop.
recycle.py
This file contains hidden or 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
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