Skip to content

level_1 is done#1

Open
sleepwalkcapsule wants to merge 1 commit intomainfrom
level_1
Open

level_1 is done#1
sleepwalkcapsule wants to merge 1 commit intomainfrom
level_1

Conversation

@sleepwalkcapsule
Copy link
Owner

No description provided.

Copy link

@vppuzakov vppuzakov left a comment

Choose a reason for hiding this comment

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

👍 в целом в рамках задание все супер! поэтому аппрув и вмерживай.
💡 остальное по комментариям посмотри и поправь в рамках следующих пулл риквестов

@@ -0,0 +1 @@
venv/ No newline at end of file

Choose a reason for hiding this comment

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

💡 вообщем то сильно без разницы, я чтобы окружение под ногами не мешалось обычно в .venv делаю (как и многие тулзы вроде poetry, pdm) и прочих

if __name__ == '__main__':
pass # код писать тут
new_user = User(name="Human", username="Towel", age=22, phone="+7(999)999-99-99")
print(f"Информация о пользователе:\nИмя - {new_user.name}.\nЛогин - {new_user.username}.\nВозраст - {new_user.age}.\nМобильный телефон - {new_user.phone}.")

Choose a reason for hiding this comment

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

💡 еще можно сделать метод __str__(self) -> str в User и его использовать тут


if __name__ == '__main__':
pass # код писать тут
new_user = User(name="Human", username="Towel", age=22, phone="+7(999)999-99-99")

Choose a reason for hiding this comment

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

👍

if __name__ == '__main__':
pass # код писать тут

student = Student(name='Mark', surname='Proskurin', faculty='Python Development', course=2)

Choose a reason for hiding this comment

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

👍


class Product:
pass # код писать тут
def __init__(self, name: str, description: str, price: int, weight: int):

Choose a reason for hiding this comment

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

👍 в целом все верно
💡 у конструктора тоже указывай аннотацию на возвращаемое значение -> None
💡 для price лучше использовать Decimal

def increase_balance(self, income: float):
pass # код писать тут

self.balance += income

Choose a reason for hiding this comment

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

💡 задай аннотацию на возвращаемое значение, используй -> None, если ничего не возвращает


if __name__ == '__main__':
pass # код писать тут
bank_account = BankAccount(owner_full_name='User Name', balance=1200.91)

Choose a reason for hiding this comment

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

👍 все верно
💡 бонусом попробуй сделать баланс 0.2 и увеличить его потом 0.1 и проанализируй результат

self.balance += income

def decrease_balance(self, expense: float):
if self.balance - expense < 0:

Choose a reason for hiding this comment

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

👍 абсолютно верно, не трогаем баланс, пока не уверены что можем с него списать заданную сумму

def increase_balance(self, income: float):
self.balance += income

def decrease_balance(self, expense: float):

Choose a reason for hiding this comment

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

💡 указывай аннотации типов на выходное значение, иначе непонятно, либо функция ниче не возращает, либо забыли указать аннотацию


if __name__ == '__main__':
pass # код писать тут
account = BankAccount('Name User', 1000.0)

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

Comments