a5_part2_xxxxxx.py - class Point'class that represents a...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
class Point: 'class that represents a point in the plane' def __init__(self, xcoord=0, ycoord=0): ''' (Point,number, number) -> None initialize point coordinates to (xcoord, ycoord)''' self.x = xcoord self.y = ycoord def setx(self, xcoord): ''' (Point,number)->None Sets x coordinate of point to xcoord''' self.x = xcoord def sety(self, ycoord): ''' (Point,number)->None Sets y coordinate of point to ycoord''' self.y = ycoord def get(self): '''(Point)->tuple Returns a tuple with x and y coordinates of the point''' return (self.x, self.y) def move(self, dx, dy): '''(Point,number,number)->None changes the x and y coordinates by dx and dy'''
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern