Python

Python Menu

Python

Python Set symmetric_difference_update() - Definition, Syntax, Parameters, Examples

Definition

The symmetric_difference_update() method updates the original set by removing items that are present in both sets, and inserting the other items.

Syntax

set.symmetric_difference_update(set)

Parameters

Parameter Description
set Required. The set to check for matches in

Examples:

persons1 = {"Mark", "Jeff", "Ivan", "Mike"} persons2 = {"Arnel", "Marie", "Ivan", "Alex"} persons1.symmetric_difference_update(persons2) print(persons1)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods