[Python] 纯文本查看 复制代码#!/usr/bin/python3
# _*_ coding:utf-8 _*_
if __name__ == '__main__':
number_list = [1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1750, 1800, 1850, 1900, 1950, 2000]
number = len(number_list)
end_list = []
for i in range(0, number - 2):
for j in range(i + 1, number):
for k in range(j + 1, number):
for l in range(k + 1, number):
str_number = str(number_list[i] ) + ', ' +str(number_list[j] ) + ', ' +str(number_list[k] ) + ', ' +str(number_list[l] )
sum_number = number_list[i] + number_list[j] + number_list[k] + number_list[l]
end_list.append([str_number, sum_number])
for i in range(len(end_list)):
if (end_list[i][1] >= 5950 and end_list[i][1] <= 6000):
print(end_list[i][0] + u' 和是' + str(end_list[i][1]))