Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 35 discussion

Actual exam question from Python Institute's PCAP
Question #: 35
Topic #: 1
[All PCAP Questions]

A variable stored separately in every object is called:

  • A. there are no such variables, all variables are shared among objects
  • B. a class variable
  • C. an object variable
  • D. an instance variable
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
locloc91
Highly Voted 5 years, 3 months ago
The answer should be D!?
upvoted 26 times
...
Pygineer
Highly Voted 4 years, 11 months ago
answer is D
upvoted 9 times
...
Adeshina
Most Recent 1 year, 11 months ago
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.
upvoted 3 times
...
macxsz
2 years, 7 months ago
Selected Answer: D
D. an instance variable
upvoted 1 times
...
TestPyth
2 years, 10 months ago
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
upvoted 1 times
...
Brodeh
3 years, 8 months ago
ANswer is A
upvoted 1 times
...
FR99
4 years, 1 month ago
The Answer is definitely 'D. an instance variable'
upvoted 1 times
...
puneetk
4 years, 4 months ago
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.
upvoted 1 times
AshitAdhikari
3 years, 4 months ago
No. Every object shares a single copy of the class variable. So 'B' cannot be the right answer.
upvoted 1 times
...
...
imsaad
4 years, 4 months ago
should be D
upvoted 1 times
...
pedrorodrigwez
4 years, 4 months ago
Correct Answer is A. Python does not use variables per se, in fact, "variables" in python are just references to objects.
upvoted 2 times
WorkingDaddy
4 years, 4 months ago
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...?
upvoted 1 times
...
...
pshdreddy
4 years, 6 months ago
Answer should be D
upvoted 3 times
...
anjuvinayan
4 years, 12 months ago
an instance variable is correct answer
upvoted 7 times
...
SophieSu
5 years ago
Answer should be D
upvoted 7 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...