标签:style blog class code tar c
刷刷Python基本功...列表解析
附上代码:
1 x = int(input())
2 y = int(input())
3 z = int(input())
4 n = int(input())
5 print [[i, j, k] for i in xrange(x+1) for j in xrange(y+1) for k in xrange(z+1) if i+j+k != n]
hackerrank---List Comprehensions,布布扣,bubuko.com
hackerrank---List Comprehensions
标签:style blog class code tar c
原文地址:http://www.cnblogs.com/Stomach-ache/p/3721898.html