总结:简简单单写循环,不要看不起任何一道题目
def fun1(candies,num_people):'''简简单单写循环,分糖果直到糖果数为0:param candies::return:'''i = 1result = [0] * num_peoplewhile candies > 0:if candies >= i:result[(i - 1) % num_people] += icandies -= ielse:result[(i - 1) % num_people] += candiescandies = 0i += 1return result