Commit c0ee02e7 authored by Zach Ingbretsen's avatar Zach Ingbretsen

Adds comments and clarifies variable name

parent c1998b20
......@@ -43,12 +43,16 @@ if __name__ == "__main__":
print(f"Numbers tested: {n_tries}")
# This calculates each person's overnight stash
# and the number remaining in the total pile
stashes = []
for i in range(n_people):
a, total = split_shares(total, n_people)
indiv_share, total = split_shares(total, n_people)
# This is the share to be evenly split in the morning
share = int(total / n_people)
print(f"In the morning, each person received a share of: {share}")
# Displays the take-home amounts of all individuals
for i, amt in enumerate(stashes):
print(f"Person {i} ended up with {amt + share}")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment