A
Q. What is the output of the following code?
Code:
class Point:
def __init__(self, x = 0, y = 0):
self.x = x+1
self.y = y+1
p1 = Point()
print(p1.x, p1.y)
def __init__(self, x = 0, y = 0):
self.x = x+1
self.y = y+1
p1 = Point()
print(p1.x, p1.y)
- Correct Answer - Option(C)
- Views: 26
- Filed under category Python
- Hashtags:
Discusssion
Login to discuss.