DS301222 #what is class and objects in python? explain with example

Python is an object oriented programming language.
Almost everything in Python is an object, with its properties and methods.
A Class is like an object constructor, or a “blueprint” for creating objects.

Example of class:

class MyClass:
x = 5

Example of object:

p1 = MyClass()
print(p1.x)

3 Likes

Correct @vaishu.swap10112016

Correct Keep it up @vaishu.swap10112016