Python

Python Menu

Python

Python delattr() Function - Definition, Syntax, Parameters, Examples

Definition

The delattr() function will delete the specified attribute from the specified object.

Syntax

delattr(object, attribute)

Parameters

Parameter Description
object Required. An object.
attribute Required. The name of the attribute you want to remove.

Examples

class Student: name = "Mark" age = 16 country = "Germany" print(getattr(Student, 'age')) delattr(Student, 'age') getattr(Student, 'age')

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods