import random s = [] sums = 0 for i in range(1,16): t = random.randint(0,500) s.append(t) sums += t print('和为: ', sums) s.sort() print('升序排列:', s)