tutorialsPythonBasic.basic.classes.class module

A class creation and usage example.

class tutorialsPythonBasic.basic.classes.class.Person(name, surname, age)[source]

Bases: builtins.object

Create an example Person class that can introduce himself or herself.

>>> anna = Person("Anna", "Smith", 22)
>>> anna.say_hello()
Hello, I am Anna Smith and I am 22 years old!
say_hello()[source]

Introduces himself or herself