print( differences({1, 2, 3}, {2, 3, 4, 5}) ) # 3
print( differences({'john', 'mark', 'paul'}, {'john', 'mark'}) ) # 1Module 13 Assignments
Short Project 11
Due date: Wednesday, November 25, 2026 at 9pm
Programming Problems
Due date: Wednesday, November 25, 2026 at 9pm
Programming Problem 25
Write a Python function that does the following:
- Its name is
differences - It takes two sets as arguments:
set_1andset_2 - It calculates and returns the number of elements that are different (not in common) between the two parameter sets
- It returns an integer with the number of different elements
Test cases:
Name the program differences.py. Make sure that gradescope gives you the points for passing the test case.
Programming Problem 26
Write a Python function that does the following:
- Its name is
has_duplicate - It takes a single list as argument
- It returns
Trueif the list contains any duplicate values,Falseif all values are unique
Test cases:
print( has_duplicate([]) ) # False
print( has_duplicate([1, 2, 3, 1]) ) # True
print( has_duplicate([1, "a", "b", 4, 5]) ) # False
print( has_duplicate([1, "a", "a", 2, 3, 4]) ) # TrueName the program detect_duplicates.py. Make sure that gradescope gives you the points for passing the test case.