mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Neaten-up the named tuple docs
This commit is contained in:
parent
d08a8ebf2a
commit
15b5e55b48
2 changed files with 8 additions and 8 deletions
|
@ -123,7 +123,7 @@ if __name__ == '__main__':
|
|||
def hypot(self):
|
||||
return (self.x ** 2 + self.y ** 2) ** 0.5
|
||||
def __str__(self):
|
||||
return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
|
||||
return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)
|
||||
|
||||
for p in Point(3, 4), Point(14, 5/7.):
|
||||
print p
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue