0
0 комментариев

Python 3.8 — Windows — AttributeError: ‘tuple’ object has no attribute ‘append’

[apcode language=»python»]

def Tournament():
    listE = (Enemy1, Enemy2, Enemy3, Enemy4, Enemy5, Enemy6, Enemy7, Enemy8, Enemy9, Enemy10,
             Enemy11, Enemy12, Enemy13, Enemy14, Enemy15, Enemy16, Enemy17, Enemy18, Enemy19, Player)
    list = listE
    C = 0
    listD = ()
    while True:
        x = 0
        list = sorted(list, key=lambda *args: random.random())
         while x < len(list):
            a = list[x]
            b = list[x + 1]
            if a['Name'] == Player['Name']:
                lx = BattlePlayer(b, b['Name'], b['ST'], b['EN'], b['AG'], b['LK'], True)
            elif b['Name'] == Player['Name']:
                lx = BattlePlayer(a, a['Name'], a['ST'], a['EN'], a['AG'], a['LK'], True)
            else:
                lx = BattleEnemy(a, a['Name'], a['ST'], a['EN'], a['AG'], a['LK'],
                                 b, b['Name'], b['ST'], b['EN'], b['AG'], b['LK'], True)
            x += 2
            listD.append(lx)  #!!!ПОЧЕМУ ВЫДАЁТ ОШИБКУ???
         Save()
        for i in list:
           print(i)
        if len(list) == 1:
            NameWin = list[0]
            print(NameWin['Name'])
            input('Цикл завершён')
            break
        C += 1
        input('Цикл - ' + str(C))

[/apcode]

Решенный вопрос
Добавить комментарий