Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Instance and Class Variables | Introduksjon til Python OOP
Objektorientert Programmering i Python

Instance and Class Variables

Sveip for å vise menyen

When working with Python classes, understanding the two main types of variables is essential. Instance variables belong to individual objects created from a class, holding data unique to each instance. Class variables are shared across all instances of the class, storing data that is common to every object.

question mark

What is the main difference between instance variables and class variables?

Velg det helt riktige svaret

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 6

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Seksjon 1. Kapittel 6
some-alt