Cart Total

In an online store, the final cart total depends on item prices, quantities, and a shared discount. Given a list items, where each item contains price and qty, and a discount percentage discount, calculate the total cost. Apply the discount and return the result rounded to two decimal places.

Примеры

Ввод
[[100, 2], [50, 1]], 0
Вывод
250
Ввод
[[100, 1]], 10
Вывод
90
Ввод
[], 50
Вывод
0

Нужно реализовать

def cart_total(items: list, discount: int) -> float:

Теги

dictmath
PostgreSQLv16

Εδώ θα εμφανιστεί το αποτέλεσμα εκτέλεσης του κώδικα

Tests12
Visible tests
Κρυφό τεστ 7
Κρυφό τεστ 8
Κρυφό τεστ 9
Κρυφό τεστ 10
Κρυφό τεστ 11
Κρυφό τεστ 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid