about | help | code help+videos | done | prefs |
intersect
Write a function intersect(data1, data2) that returns True if the two lists named data1 and data2 have any common elements, and False otherwise. For example, intersect([’Katniss’, ’Peeta’, ’Gale’], [’Foxface’, ’Marvel’, ’Glimmer’]) should return False, but intersect([’Katniss’, ’Peeta’, ’Gale’], [’Gale’, ’Haymitch’, ’Katniss’]) should return True. intersect([1, 2, 3, 4, 5], [2, 4, 6, 8, 10]) → True intersect(['a', 'b', 'c', 'd', 'e'], ['f', 'f', 'h', 'i', 'j']) → False intersect(['Bart', 'Lisa', 'Homer', 'Marge', 'Maggie'], ['Peter', 'Meg', 'Stewie', 'Lois', 'Chris']) → False ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy