Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Lesson06#887

Open
AlexN-github wants to merge 9 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
AlexN-github:lesson06AlexN-github/Python_lessons_basic:lesson06Copy head branch name to clipboard
Open

Lesson06#887
AlexN-github wants to merge 9 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
AlexN-github:lesson06AlexN-github/Python_lessons_basic:lesson06Copy head branch name to clipboard

Conversation

@AlexN-github

Copy link
Copy Markdown

Выполнил все


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

class ravtrapetc:

Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.