πŸ“Š Python
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)
πŸ’¬ Discuss
βœ… Correct Answer: (C) (1, 1)

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
175
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Tanmay
Publisher
πŸ“ˆ
94%
Success Rate