Skip to content

Instantly share code, notes, and snippets.

@beauvais
Created November 22, 2012 14:36
Show Gist options
  • Save beauvais/4131479 to your computer and use it in GitHub Desktop.
Save beauvais/4131479 to your computer and use it in GitHub Desktop.
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