Python Classes/ObjectsObject-Oriented Programming.ExamplesCreate ClassDefining a class and creating an object.class MyClass: x = 5 p1 = MyClass() print(p1.x) Try it YourselfThe __init__() FunctionInitializing object properties.class Person: def __init__(self, name, age): self.name = name self.age = age p1 = Person("John", 36) print(p1.name) print(p1.age) Try it YourselfTest Your KnowledgePython QuizNo quiz available for this topic yet.PreviousNext