Python

Python Menu

Python

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

Definition

The remove() method removes the specified element from the set. This method will raise an error if the specified item does not exist.

Syntax

set.remove(item)

Parameters

Parameter Description
item Required. The item to search for, and remove

Examples:

persons = {"Arnel", "Marie", "Mark", "Jeff", "Ivan", "Mike"} persons.remove("Arnel") print(persons)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods