<property object =“”at =“”0x00000242b5f7af98 =“”>你能尝试打印x的值吗?

时间:2018-02-17 14:29:13

标签: python python-3.x

from collections import namedtuple

points=namedtuple("points","x y z")

color=namedtuple("color","red blue green")

pixel=namedtuple("pixel",points._fields+color._fields)

pixel(11,12,13,14,15,16)

print(pixel.x)

1 个答案:

答案 0 :(得分:1)

pixel(11,12,13,14,15,16)分配给变量并再次尝试:

variable = pixel(11,12,13,14,15,16)
print(variable.x)