Français
Ouvrir dans Telegram

Fil de discussion# создание магазина

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. W
    Photo
    cliquez pour afficher
      1. K
        ∅мάρς∅V͇ I͇ P͇, Вы увеличили карму Wavvy ДУБЛИРУЙТЕ до -14.46 (+6.86) Внимание Wavvy ДУБЛИРУЙТЕ! У Вас отрицательная карма. Как только она достигнет -100 Вы не сможете писать в чат на протяжении 30 дн.
ССообщество Python ПрограммистовСообщество Python Программистов@python_scripts · groupe · Technologie
4 169membres43écrivent en 30 jours
Fil de la communauté Ouvrir dans Telegram

Un fil public ouvert issu de l'index de recherche ChatCrawler — « le Google du Telegram public » ; actualisé à mesure que la communauté est explorée. Les heures sont en UTC.

Contenu public uniquement, API officielle de Telegram. À propos · FAQ · Limites de l'index · Retirer une page · Catalogue · Recherche · Comment nous comptons