Skip to content

ДЗ2#830

Open
Stvaik wants to merge 11 commits into
GeekBrainsTutorial:masterfrom
Stvaik:master
Open

ДЗ2#830
Stvaik wants to merge 11 commits into
GeekBrainsTutorial:masterfrom
Stvaik:master

Conversation

@Stvaik

@Stvaik Stvaik commented Aug 17, 2019

Copy link
Copy Markdown

No description provided.

list_1 = [1, 3, 5, 8, 9]
list_2 = [1, 7, 4, 15, 9]
list_1.pop(0)
list_1.pop(3)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А если список изменится? Надо чтоб программа проверяла

pass

def my_round(number, digits):
multiplier = pow(10.0, digits)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А ведь в условии сказано не использовать встроенные функции, это относится и к функции pow


def lucky_ticket(ticket_number):
pass
lucky_ticket = lambda x :(lambda x : 'yes' if sum(x[:3]) == sum(x[3:]) else 'no')(map(int, list(str(x))))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В таких задачах желательно чтоб функция возвращала булевое

import math
class Triangle:
def __init__(self, A, B, C):
def sideLen(dot1, dot2):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше сделать методом

self.AB = sideLen(self.A, self.B)
self.BC = sideLen(self.B, self.C)
self.CA = sideLen(self.C, self.A)
def areaTriangle(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Именование методов как и функции snake_case

self.patronymic = patronymic

def get_full_name(self):
return self.name + ' ' + self.patronymic + ' ' + self.surname

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше через форматирование, будет более явно и исключается ошибка типов

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