logo

Crowdly

Browser

Add to Chrome

次のコードを実行したとき,どのような出力を得るか? class Point_test:   def __init__(self, x, y):     sel...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

次のコードを実行したとき,どのような出力を得るか?

class Point_test:

  def __init__(self, x, y):

    self.x = x

    self.y = y

  def midpoint(self, p):

    return Point_test((self.x + p.x) / 2, (self.y + p.y) / 2)

 

p1 = Point_test(2, 4)

p2 = Point_test(0, 0)

print(p1.midpoint(p2).x, p2.midpoint(p1).y)

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on letus.ed.tus.ac.jp?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome