Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 38)
38.
What will be the output of the following Python code?
class MyClass:
x = 10
obj = MyClass()
obj.x += 5
result = obj.x
print(result)
Answer: Option
Explanation:
The attribute
x
is incremented by 5 using the instance obj
.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers