Answer:
def printStudent(englishStudent, mathStudent):
onlyMath = mathStudent
for m in mathStudent:
if m in englishStudent:
i = onlyMath.index(m)
onlyMath.pop(i)
print(onlyMath)
# just an example:
printStudent([1193, 4356, 4572, 1035], [3954, 1035, 8548, 1193])
Step-by-step explanation:
I made onlyMath as a copy of mathStudent. Then, with a for loop, the algorithm checks every ID in it and removes the ones that are also in englishStudent, leaving only the math students.