使用count计数功能 # -*- coding:utf-8 -*- class Solution: def MoreThanHalfNum_Solution(self, numbers): # write code here length = len(numbers)//2 for i in numbers: if numbers.count(i)>length: return i return 0