Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Classes | Classes and Objects
Object-Oriented Programming in Python

bookClasses

About an OOP

OOP or Object Oriented Programming is a programming paradigm with the idea of a specific program organization when the programmer manipulates objects in the code.

OOP has such main principles:

  • Inheritance;
  • Encapsulation;
  • Polymorphism.

Class

Class is like a custom data type or structure but allows you to keep more complex data.

Imagine your project requires cats representation. What do you know about them?

They have stable hair color, eyes color, a number of legs, for example. You can measure the cat's weight and the length of the tail. A cat can move and sleep, cry and eat, and give birth to another cat.

All these features can be interpreted and used in the class Cat.

1234
class Cat: pass print(Cat)
copy

The class is empty now and does nothing.

question mark

What does OOP mean?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 1

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Posez-moi des questions sur ce sujet

Résumer ce chapitre

Afficher des exemples du monde réel

Awesome!

Completion rate improved to 7.69

bookClasses

Glissez pour afficher le menu

About an OOP

OOP or Object Oriented Programming is a programming paradigm with the idea of a specific program organization when the programmer manipulates objects in the code.

OOP has such main principles:

  • Inheritance;
  • Encapsulation;
  • Polymorphism.

Class

Class is like a custom data type or structure but allows you to keep more complex data.

Imagine your project requires cats representation. What do you know about them?

They have stable hair color, eyes color, a number of legs, for example. You can measure the cat's weight and the length of the tail. A cat can move and sleep, cry and eat, and give birth to another cat.

All these features can be interpreted and used in the class Cat.

1234
class Cat: pass print(Cat)
copy

The class is empty now and does nothing.

question mark

What does OOP mean?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 1
some-alt