Skip to content

2. Раджабов Руслан Ильгамович. 614 - #87

Open
somet1me123 wants to merge 10 commits into
python-department:mainfrom
somet1me123:2.-Раджабов-Руслан-Ильгамович.-614

Hidden character warning

The head ref may contain hidden characters: "2.-\u0420\u0430\u0434\u0436\u0430\u0431\u043e\u0432-\u0420\u0443\u0441\u043b\u0430\u043d-\u0418\u043b\u044c\u0433\u0430\u043c\u043e\u0432\u0438\u0447.-614"
Open

somet1me123 wants to merge 10 commits into
python-department:mainfrom
somet1me123:2.-Раджабов-Руслан-Ильгамович.-614

Conversation

@somet1me123

Copy link
Copy Markdown

No description provided.

@github-actions github-actions Bot added the 614 label Oct 2, 2026
Comment thread src/part2/cart.py
new_fields = (product[NAME_INDEX], product[PRICE_INDEX], new_quantity)
update_product(storage, product_id, new_fields)
for i in range(len(cart)):
if cart[i][LINE_PRODUCT_ID_INDEX] == product_id:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Во многом эта логика поиска и обновления позиций в корзине дублирует логику поиска и обновления позиций в корзине из функции add_to_cart. Следовало вынести эту логику в отдельную функци.

Нарушение критерия S1. Минус балл

Comment thread src/part2/crud.py
name, price, quantity = fields
for item in storage:
if name == item[NAME_INDEX]:
print(f"product name '{name}' is already taken")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Вместо явного использования кавычек лучше делать так:

Suggested change
print(f"product name '{name}' is already taken")
print(f"product name {name!r} is already taken")

Comment thread src/part2/crud.py
Args:
storage: The product store to search.
product_id: The identifier to look up.
for i in range(len(storage)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Нарушение критерия T5. Минус 0.25 балла

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants