Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A set operation exercise Write a function find_programming_engineers (engr101_st

ID: 3757213 • Letter: A

Question

A set operation exercise Write a function find_programming_engineers (engr101_students, cosc121_students) that finds the names of students that are engineers and do programming- i.e. the Software, Mechatronics, and Computer Engineering students The function is given two sets - one containing the names of students taking ENGR101 and the other containing the names of students taking COSC121. It should return a set of the names of students that are taking both papers Note: You cannot use any for loops, while loops, or if statements. You are expected to solve this using set operations For example: Test Result engr101-f David Smith Joanna Rodriguez', "John Smith', Maria Martinez', 'Sam Cassidy", David Smith Maria Martinez Sam Cassidy cosc121 - Sam Cassidy, 'Maria Martinez', David Smith', "David Chu', Jennifer Johnston for person in sorted(find_programming_engineers(engr101, cosc121)): print(person) engr -f'Nancy Tennant', Simon Wright') cosc-'James Logan', 'Neo' print(find_programming_engineers (engr, cosc) set()

Explanation / Answer

def find_programming_engineers(engr101_students, cosc121_students): common = [] for student in engr101_students: if student in cosc121_students: common.append(student) return common

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote