找出1-9中有那些组合相加等于一个特定值,例如说20 num = [1,2,3,4,5,6,7,8,9] def count(num,n): # num = list(sorted(filter(lambda x: x <= n, num))) # print(num) combinations_i
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号