-
Notifications
You must be signed in to change notification settings - Fork 72
Lesson 13 #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Lesson 13 #707
Conversation
Signed-off-by: Grzegorz Bajorski <[email protected]>
| dist = math.sqrt(dx**2 + dy**2) | ||
| return dist | ||
|
|
||
| class Point: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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() | ||
|
|
||
|
|
There was a problem hiding this comment.
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 : |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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]>
gradopaw
left a comment
There was a problem hiding this 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: |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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)
Signed-off-by: Grzegorz Bajorski [email protected]