Python Set difference_update() method

Facebooktwitterredditpinterestlinkedinmailby feather

Python Set difference_update() method

The set.difference_update() method in Python removes the items that exist in both sets.

Syntax

Parameter

set- This argument represents a set (minuend)

set1- This arguments represents a set(subtrahend)

Return

None

Example 1

Output

Example 2

Output

Example 3

Output

Facebooktwitterredditpinterestlinkedinmailby feather