Compsci 6, Fall 2011, Classwork 13
PRINT Names and NetID of students in group (min 2, max 3)
Name: __________________________ NetID: _____________ Name: __________________________ NetID: _____________
Name: __________________________ NetID: _____________
Problem 1:
This problem is related to the setExample.py code.
def peopleTakingCourses(data):
''' data is a list of lists of names for each course,
return list of all strings that appear at least once '''
names = set([])
for lista in data:
Problem 2:
This problem is related to the setExample.py code.
def peopleTakingOnlyOneCourse(data):
''' data is a list of lists of names for each course,
returns list of people taking only one course '''
names = set([])
for lista in data:
Problem 3:
Write an algorithm for UniqueZoo.
Problem 4:
Write unionAllSetsButMe(allsets, me).
allsets is a list of sets. me is the index of one of the sets.
Return the union of all the sets except the set indexed by me.
def unionAllSetsButMe(allsets, me):
Problem 5:
Write an algorithm for namesForYear(courses, year)