English
Open in Telegram

Thread# создание магазина

4 messages · –
ᴍ
# создание магазина 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) как быть?
      1. K
        ∅мάρς∅V͇ I͇ P͇, Вы увеличили карму Wavvy ДУБЛИРУЙТЕ до -14.46 (+6.86) Внимание Wavvy ДУБЛИРУЙТЕ! У Вас отрицательная карма. Как только она достигнет -100 Вы не сможете писать в чат на протяжении 30 дн.
ССообщество Python ПрограммистовСообщество Python Программистов@python_scripts · group · Tech
4 169members43writing in 30 days
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count