Skip to content

Conversation

@UzunovD
Copy link

@UzunovD UzunovD commented Nov 23, 2023

No description provided.

Copy link

@krepysh krepysh left a comment

Choose a reason for hiding this comment

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

Всего одно небольшое дополнение.

try:
price = abs(float(price))
except (ValueError, TypeError):
print(f'Для параметра "price" передан некорректный тип данных {price}')
Copy link

Choose a reason for hiding this comment

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

Здорово, только я бы вернул строку вместо принт. Это дает более поддерживаемый и переиспользуемый код.

Copy link
Author

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