Created
November 22, 2012 14:36
-
-
Save beauvais/4131479 to your computer and use it in GitHub Desktop.
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
discussion = {} | |
discussion['John'] = 45 | |
discussion['Graham'] = 30 | |
discussion['Michael'] = 20 | |
discussion['Terry'] = 30 | |
def talk_time(argv): | |
count = 0 | |
remaining = sum(argv.values()) | |
print("OK, we are ready to start." + "\n") | |
for k, v in argv.items(): | |
print(str(k) + " starts talking when session has been going for " + str(count) + " minutes.") | |
count += v | |
remaining -= v | |
if remaining > 0: | |
print("after " + k + ", the session has: " + str(remaining) + " minutes to go") | |
elif remaining < 0: | |
over = remaining * -1 | |
print over | |
print("... and we ran over by " + over + " minutes!") | |
else: | |
pass | |
print(talk_time(discussion)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment