There is a typo in answer C. "var" should be capitalized "Var":
class Class:
Var = data = 1
def __init__(self,value):
self.prop = value
Object = Class(2)
print(len(Class.__dict__) == 1) # False
print("data" in Class.__dict__) # True
print("Var" in Class.__dict__) # True
print("data" in Object.__dict__) # False
print(Class.__dict__)
print("*************")
print(Object.__dict__)
print(isinstance(obj_b,A)) # ans A, The isinstance() function returns True
# if the specified object is of the specified type
# return false
print(A.VarA ==1) # ans B, A.VarA = 1, so A.VarA ==1. Then,it return true
print(obj_a is obj_aa) # ans C, return false
print(B.VarA == 1) # ans D, B.VarA = 2, so B.VarA not == 1. Then, it return false
The correct answer should be B,C
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
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.
mazimir
Highly Voted 3 years, 8 months agodicksonpwc
Most Recent 2 years, 2 months agodicksonpwc
2 years, 2 months ago9prayer
2 years, 4 months agoJnanada
2 years, 10 months agomacxsz
3 years, 1 month agoAngel75
3 years, 4 months agoit_man_531
3 years, 5 months agoNoarmy315
3 years, 6 months agoDTL001
3 years, 6 months agovlobachevsky
3 years, 8 months ago