How can I compare the max_count with the values of the areas affected dict if '<' is not supported?

Couple of things:

  • On line 111, you have a typo amx_area_count

  • On line 108, you have:

// Your code:
max_area_count = affected_areas_count

// It should be:
max_area_count = affected_areas_count[area]

When the if condition is met, you are assigning the whole dictionary to max_area_count. Instead you want to assign the integer value associated with the candidate area.