猫史档案馆


萌新求问!!!

用户:CHN_流星CHN_流星查看:2 回复:2 评论:2 创建时间:2021-08-23T17:40:08


此段代码的错误:

        for _count in self.scores:
            c = self.dice_answers.count(_count)
            dice_answer_count.append(c)
        max_answer_index = dice_answer_count.index(max(dice_answer_count))
        dice_answer_count[dice_answer_count.index(max(dice_answer_count))] = 0
        while dice_answer_count.index(max(dice_answer_count)) in max_answer_index:
            max_answer_index = dice_answer_count.index(max(dice_answer_count))
            dice_answer_count[dice_answer_count.index(max(dice_answer_count))] = 0

#缩进没问题,报错:TypeError: argument of type 'int' is not iterable

很急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


回复

上一页1 页 / 共 1下一页
lsk666666lsk666666

max_answer_index不能是int类型

self.scores不能是int类型

点赞2


评论


编码已破译编码已破译

数字类型不能迭代

点赞0


评论