Posts

Showing posts from March, 2023

Everything is an object in python: Mutable and immutable object

Image
  Introduction to mutable, immutable objects in python As we have seen in different python programs, Python is a more accessible programming language widely used in various fields like data science, machine learning, artificial intelligence, and others. One important concept that every developer must understand is the concept of mutable objects in Python. First, what is an object in Python? In Python, everything is an object. Everything from simple data types like integers and strings to complex data structures like sets and lists are objects. An object in Python is an instance of a class. We can define A class as a well planned design for creating objects. In Python, we can create our own classes to define our own classes of objects with specific behaviors and properties. A class defines the attributes and methods of an object. Attributes are properties that describe the object, while methods are functions that define the object's behavior. To create an object in Python, you first...