Abruptly Goblin Planner Step 8

Hello! I’m quite new to Python and programming in general. Some of it I get quite easily and some things are harder to fathom.
I need some help comprehending how the 8th step in this off-platform project works.
I’ve put in the code up until step 8 below:

gamers = []

def add_gamer(gamer, gamers_list):
  if gamer.get('name') and gamer.get('availability'):
    gamers_list.append(gamer)
  else:
    print('Important information missing from player')

kimberly = {'name': 'Kimberly Warner', 'availability': ['Monday', 'Tuesday', 'Friday']}
add_gamer(kimberly, gamers)

add_gamer({'name': 'Thomas Nelson', 'availability': ['Tuesday', 'Thursday', 'Saturday']}, gamers)
add_gamer({'name': 'Joyce Sellers', 'availability': ['Monday', 'Wednesday', 'Friday', 'Saturday']}, gamers)
add_gamer({'name': 'Michelle Reyes', 'availability': ['Wednesday', 'Thursday', 'Sunday']}, gamers)
add_gamer({'name': 'Stephen Adams', 'availability': ['Thursday', 'Saturday']}, gamers)
add_gamer({'name': 'Joanne Lynn', 'availability': ['Monday', 'Thursday']}, gamers)
add_gamer({'name': 'Latasha Bryan', 'availability': ['Monday', 'Sunday']}, gamers)
add_gamer({'name': 'Crystal Brewer', 'availability': ['Thursday', 'Friday', 'Saturday']}, gamers)
add_gamer({'name': 'James Barnes Jr', 'availability': ['Tuesday', 'Wednesday', 'Thursday', 'Sunday']}, gamers)
add_gamer({'name': 'Michel Trujillo', 'availability': ['Monday', 'Tuesday', 'Wednesday']}, gamers)

def build_daily_frequency_table():
  return {
    'Monday': 0,
    'Tuesday': 0,
    'Wednesday': 0,
    'Thursday': 0,
    'Friday': 0,
    'Saturday': 0,
    'Sunday': 0,
  }

count_availability = build_daily_frequency_table()

def calculate_availability(gamers_list, available_frequency):
  for gamer in gamers_list:
    for day in gamer['availability']:
      available_frequency[day] += 1

calculate_availability(gamers, count_availability)
#print(count_availability)

This is the part I don’t quite understand:
It is supposed to find out which night most gamers are available. In the code provided, the night with the most gamers available is Thursday. But, what happens if two nights have the same amount of gamers available? I tried making Monday have the same amount as Thursday, and the code outputs only Monday.

def find_best_night(availability_table):
  best_availability = 0
  for day, availability in availability_table.items():
    if availability > best_availability:
      best_night = day
      best_availability = availability
  return best_night

print(find_best_night(count_availability))

Also, why do we have to put in best_night = day and best_availability = availability? I noticed that if I took out the best_availability, it printed Sunday as the best night.

After hours of trying and failing i figured out an OK solution to the problem. I’d prefer a more compact code, but this will just have to do for now:

def find_best_day(availability_table):
  best_days = []
  max_value = 0
  for weekday, count in availability_table.items():
    if count > max_value:
      best_day = weekday
      max_value = count
  for weekday, count in availability_table.items():
    if count >= max_value:
      best_days.append(weekday)
  return best_days

game_night = find_best_day(count_availability)
print(game_night)

This does output all days (whether it’s a single day or multiple days) available.
Hopefully I’ll learn how to write more compact codes as I go.
If anyone has a better solution, please do share.