Python Class
Python Classes/Objects
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.
Create a Class
To create a class, use the keyword class
:
Example
Create a class named MyClass, with a property named x:
class MyClass:
x = 5
Try it Yourself »
x = 5
Related Pages
Python Syntax Tutorial Create Class The Class __init__() Function Object Methods self Modify Object Properties Delete Object Properties Delete Object Class pass Statement