...

/

Classes and Methods

Classes and Methods

This lesson discusses classes and methods in Python.

We'll cover the following...

Like other programming languages, Python is an object-oriented programming language. Classes can be created using the class keyword.

Class creation

The class can be created using a class keyword. Let’s create a simple class with no functionality.

Python 3.5
class Car:
pass
porsche = Car()
print(porsche)

In the above code, we have created a class named Car. We have created an object, porsche which is the instance of the Car class.