Skip to content

Commit 5edade5

Browse files
committed
working on the grade-school challenge
1 parent a2bbde2 commit 5edade5

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Binary file not shown.
Binary file not shown.

grade-school/grade_school.py

+16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
class School:
22
def __init__(self):
3+
4+
self.student_dict = {}
5+
36
pass
47

58
def add_student(self, name, grade):
9+
10+
self.student_dict.__setitem__(name, grade)
11+
612
pass
713

814
def roster(self):
15+
16+
return [k for k in self.student_dict.keys()]
17+
918
pass
1019

1120
def grade(self, grade_number):
21+
22+
output = []
23+
24+
list_of_keys = [key for (key, value) in self.student_dict.items() if value == grade_number]
25+
26+
return list_of_keys
27+
1228
pass

0 commit comments

Comments
 (0)