Hunter's Gym Dictionary Lab
Practice Python dictionaries by building the backend logic for a gym membership fob system.
Hunter's Gym workout illustration
Your progress
Complete the three functions, run the checker, and screenshot the passing result for your submission.
Score: 0 / 3
The checker runs behavioral tests against your Python functions. It focuses on dictionary structure, fob assignment, membership dates, and access decisions.
Case

You are a new intern at Hunter's Gym near Baruch College. Hunter needs a simple backend system to register members, assign gym fobs, and check whether a member can enter.

The gym has 10,000 fobs numbered 1 to 10000. A fob can only be assigned to one active member record at a time.

Use Python dictionaries as the data store: dictionary keys should make lookup fast, and dictionary values should hold the related member or fob information.

Questions & Guide 3 tasks
Guide
Before Q1: how is a Python function like Excel?

A Python function is a reusable mini-process. You give it inputs, it follows steps, and it can return an output. Excel formulas work the same way: a formula such as =SUM(A1:A5) takes input cells, follows a rule, and returns an answer.

def add_membership_fee(base_fee, tax): total = base_fee + tax return total

In this example, base_fee and tax are inputs, the indented lines are the steps, and return total gives back the output. As you work on Q1, think of create_gym_state() as a formula that builds the starting workbook for the gym: it creates the dictionaries the rest of the program will use.

Guide question: In your own words, how is a Python function similar to an Excel formula? Think about inputs, steps, and outputs.

Python Editor Question 1
Checker Results Loading Python...
The checker is loading. If it takes a moment, keep this page open.