D. an instance variable
In object-oriented programming, a variable that is stored separately in every object of a class is called an instance variable. An instance variable is associated with a specific instance of a class, and its value is unique to that instance. This means that if you have two objects of the same class, each object can have its own unique value for an instance variable.
A Python class variable is shared by all object instances of a class. Class variables are declared when a class is being constructed. They are not defined inside any methods of a class. Because a class variable is shared by instances of a class, the Python class owns the variable.
B IS CORRECT
Wondering, if Class Variable (B) is the right answer? Its "...A variable stored separately in every Object...", could mean a variable X in class definition, accessed by object O1, O2...On for their own copies.
Even so, python.org sayeth: "...instance variables are for data unique to each instance and class variables..." https://docs.python.org/3/tutorial/classes.html
So with Python.org's definition of "instance variable" in mind, D is correct. The "just references to objects" thing is, I think, a little beyond the scope of the PCAP exam...?
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
locloc91
Highly Voted 5 years, 3 months agoPygineer
Highly Voted 4 years, 11 months agoAdeshina
Most Recent 1 year, 11 months agomacxsz
2 years, 7 months agoTestPyth
2 years, 10 months agoBrodeh
3 years, 8 months agoFR99
4 years, 1 month agopuneetk
4 years, 4 months agoAshitAdhikari
3 years, 4 months agoimsaad
4 years, 4 months agopedrorodrigwez
4 years, 4 months agoWorkingDaddy
4 years, 4 months agopshdreddy
4 years, 6 months agoanjuvinayan
4 years, 12 months agoSophieSu
5 years ago