Skip to content
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

Lesson06 #887

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

AlexN-github
Copy link

Выполнил все


# Задача-2: Написать Класс "Равнобочная трапеция", заданной координатами 4-х точек.
# Предусмотреть в классе методы:
# проверка, является ли фигура равнобочной трапецией;
# вычисления: длины сторон, периметр, площадь.

print("Задача-2")

class ravtrapetc:

Choose a reason for hiding this comment

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

имена классам даем в CamelCase стиле

import math
len = math.sqrt((self.p2["x"] - self.p1["x"]) ** 2 + (self.p2["y"] - self.p1["y"]) ** 2)
return len
self.C = get_len(self.p1,self.p2)

Choose a reason for hiding this comment

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

неочень хорошая практика создавть атрибуты класса не в методе init, обратите внимание на то что данве строчки в студии подчеркиваются

Comment on lines +85 to +88
if A1 == A2:
return True
else:
return False

Choose a reason for hiding this comment

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

можно просто:

return A1 == A2

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.

2 participants