A

Admin • 833.24K Points
Coach

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)
  • (A) (x, y)
  • (B) (0, 0)
  • (C) (1, 1)
  • (D) (None, None)
  • Correct Answer - Option(C)
  • Views: 26
  • Filed under category Python
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.