3838 "schedule" : "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM" ,
3939 "max_participants" : 30 ,
4040 "participants" : ["john@mergington.edu" , "olivia@mergington.edu" ]
41+ },
42+ # Sports related activities
43+ "Soccer Team" : {
44+ "description" : "Join the school soccer team and compete in local leagues" ,
45+ "schedule" : "Tuesdays and Thursdays, 4:00 PM - 5:30 PM" ,
46+ "max_participants" : 18 ,
47+ "participants" : ["lucas@mergington.edu" , "mia@mergington.edu" ]
48+ },
49+ "Basketball Club" : {
50+ "description" : "Practice basketball skills and play friendly matches" ,
51+ "schedule" : "Wednesdays, 3:30 PM - 5:00 PM" ,
52+ "max_participants" : 15 ,
53+ "participants" : ["liam@mergington.edu" , "ava@mergington.edu" ]
54+ },
55+ # Artistic activities
56+ "Art Club" : {
57+ "description" : "Explore painting, drawing, and other visual arts" ,
58+ "schedule" : "Mondays, 3:30 PM - 5:00 PM" ,
59+ "max_participants" : 16 ,
60+ "participants" : ["ella@mergington.edu" , "noah@mergington.edu" ]
61+ },
62+ "Drama Society" : {
63+ "description" : "Participate in theater productions and acting workshops" ,
64+ "schedule" : "Fridays, 4:00 PM - 6:00 PM" ,
65+ "max_participants" : 20 ,
66+ "participants" : ["amelia@mergington.edu" , "jack@mergington.edu" ]
67+ },
68+ # Intellectual activities
69+ "Math Olympiad" : {
70+ "description" : "Prepare for math competitions and solve challenging problems" ,
71+ "schedule" : "Thursdays, 3:30 PM - 5:00 PM" ,
72+ "max_participants" : 14 ,
73+ "participants" : ["charlotte@mergington.edu" , "benjamin@mergington.edu" ]
74+ },
75+ "Debate Club" : {
76+ "description" : "Develop public speaking and argumentation skills" ,
77+ "schedule" : "Wednesdays, 4:00 PM - 5:30 PM" ,
78+ "max_participants" : 12 ,
79+ "participants" : ["henry@mergington.edu" , "grace@mergington.edu" ]
4180 }
4281}
4382
@@ -61,7 +100,9 @@ def signup_for_activity(activity_name: str, email: str):
61100
62101 # Get the specific activity
63102 activity = activities [activity_name ]
103+ # Validate student is not already signed up
64104
105+ if email in activity ["participants" ]:
65106 # Add student
66107 activity ["participants" ].append (email )
67108 return {"message" : f"Signed up { email } for { activity_name } " }
0 commit comments