-
Notifications
You must be signed in to change notification settings - Fork 0
/
school_v2_sets.py
40 lines (27 loc) · 995 Bytes
/
school_v2_sets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
"""Shows a report of children by activity.
Print a list of children, grouped by activity in classes
"""
__version__ = '0.1.1'
#Data
classroom1 = ['Erik', 'Maia', 'Gustavo', 'Manuel', 'Sofia', 'Joana']
classroom2 = ['Joao', 'Antonio', 'Carlos', 'Maria', 'Isolda']
english_class = ['Erik', 'Maia', 'Joana', 'Carlos', 'Antonio']
music_class = ['Erik', 'Carlos', 'Maria']
dance_class = ['Gustavo', 'Sofia', 'Joana', 'Antonio']
activities = [
('English', english_class),
('Music', music_class),
('Dance', dance_class),
]
#List students in activity, by class
for name_activity, activity in activities:
print(f'Students of the {name_activity} activity \n')
print('-' * 50)
#Class 1 have intersection with a activity
activity_room1 = set(classroom1) & set(activity)
activity_room2 = set(classroom2) & set(activity)
print('classroom 1', activity_room1)
print('classroom 2', activity_room2)
print()
print('*' * 50)