Overview:
- The method difference_update() removes elements of a set as specified by the another set.
- In other words, the difference between the original set and another set is calculated, which is updated as the contents of the original set.
Example:
# Example Python program that removes # Remove a set of instruments # Print the new set |
Output:
Brass instruments: {'Tuba', 'Piccola Trumpet', 'Bugle', 'Trumpet', 'Bass Trambone', 'French Horn'} New brass instruments: {'Tuba', 'Bugle', 'Trumpet', 'Bass Trambone', 'French Horn'} |