Skip to content

Conversation

@GrzegorzBajorski
Copy link
Contributor

Signed-off-by: Grzegorz Bajorski [email protected]

Signed-off-by: Grzegorz Bajorski <[email protected]>
dist = math.sqrt(dx**2 + dy**2)
return dist

class Point:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

attributes: x, y
"""

class Rectangle:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

"""

class Rectangle:
"""Represents a rectangle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W291 trailing whitespace

attributes: width, height, corner.
"""

def print_point(p):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

if __name__ == '__main__':
main()


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W391 blank line at end of file


if compare_attributes(person, person2, attributes):
print("Compared objects are equal")
else :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E203 whitespace before ':'

Signed-off-by: Grzegorz Bajorski <[email protected]>


class Rectangle:
"""Represents a rectangle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W291 trailing whitespace

Signed-off-by: Grzegorz Bajorski <[email protected]>
Signed-off-by: Grzegorz Bajorski <[email protected]>
Signed-off-by: Grzegorz Bajorski <[email protected]>
Copy link
Collaborator

@gradopaw gradopaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the constructor to the Person class that is used in your scripts.

return True


class Person:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add constructor to this class:

class Person:
    def __init__(self, name, age, salary):
        self.name = name
        self.age = age
        self.salary = salary

salary = 1


person = Person()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

person = Person('aa', 22, 1)
person2 = Person('bb', 24, 1)

return attr_dict


class Person:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add constructor to this class:

class Person:
    def __init__(self, name, age, salary):
        self.name = name
        self.age = age
        self.salary = salary

salary = 1


person = Person()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

person = Person('aa', 22, 1)
person2 = Person('bb', 24, 1)

return attr_dict


class Person:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class Person:
    def __init__(self, name, age, salary):
        self.name = name
        self.age = age
        self.salary = salary

salary = 1


person = Person()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

person = Person('aa', 22, 1)
person2 = Person('bb', 24, 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants