Class

A class is like a form or a questionnaire. An instance is like a form that has been filled out with information. Just like many people can fill out the same form with their unique information, many instances can be created from a single class.

Class Definition

class  Car :
	pass

Constructor

def __init__(self):
    # body of the constructor

Self

class Car:
    def __init__(self, name, topSpeed):
          self.name = name 
          self.topSpeed= topSpeed

1. **self.name = name**creates an attribute called name and assigns to it the value of the name parameter.

2. self.topSpeed= topSpeed creates an attribute called topSpeed and assigns to it the value of the topSpeed parameter.

Example :