# создание магазина
def fill_store():
items = [
('Healing potion', 50, 0, 0, 50),
('Attack potion', 100, 10, 0, 0),
('Defense potion', 100, 0, 10, 0),
('HP potion', 100, 0, 0, 10),
]
cursor.executemany("INSERT INTO items (name, price, attack, defense, hp) VALUES (?, ?, ?, ?, ?)", items)
conn.commit()
# обработчик команды /store
async def on_store(message: aiogram.types.Message):
items = get_store()
text = "Магазин:\n"
for item in items:
name, price, attack, defense, hp = item
text += f"{name} ({price} монет) - атака +{attack}, защита +{defense}, здоровье +{hp}\n"
await message.answer(text)
Ошибка:
name, price, attack, defense, hp = item
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 5)
как быть?