在0x7f6f056c2840处获取<生成器对象<genexpr>时出错

时间:2019-09-09 12:07:23

标签: python

嗨,我正在处理列表理解练习,但是我陷入了代码中,并遇到了上面提到的错误。 已经感谢您的帮助!

x = int(input())
y = int(input())
z = int(input())
n = int(input())

print([i,j,k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if not (i+j+k) == n)

1 个答案:

答案 0 :(得分:0)

尝试一下:

x = int(input())
y = int(input())
z = int(input())
n = int(input())

print(tuple([i,j,k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if not (i+j+k) == n))