如何"截断"相同长度元组的元组的最后一列?

hob*_*es3 1 python tuples

假设我有

x = ((1, 2, 3), (4, 5, 6), (7, 8, 9))
Run Code Online (Sandbox Code Playgroud)

我怎么去

x = ((1, 2), (4, 5), (7, 8))
Run Code Online (Sandbox Code Playgroud)

我想出的唯一方法是使用列表推导然后转换回元组:

x = tuple([n[1:len(n)] for n in x])
Run Code Online (Sandbox Code Playgroud)

但我觉得这是一种丑陋的做法......

Adi*_*rji 8

In [1]: x = ((1, 2, 3), (4, 5, 6), (7, 8, 9))

In [2]: tuple(a[:-1] for a in x)
Run Code Online (Sandbox Code Playgroud)