在python中,如何返回列表中的所有元组?

这是我的列表:

list_tuple = [(x1,x2,x3)(x4,x5,x6)(x7,x8,x9)]

,我只想返回所有元组。

如何返回所有元组?

这是我尝试的:

for i in list_tuple: 
   print(i)

这就是它的作用:

x1,x3

预期结果是:

(x1,x2)
(x4,x6)
(x7,x9)
hca0728 回答:在python中,如何返回列表中的所有元组?

尝试一下:

$ make --version
GNU Make 3.81
...
This program built for i386-apple-darwin11.3.0
,
    list_tuple = [(1,2,3),(4,5,6),(7,8,9)]
    for tp in list_tuple:
        print(tp)
本文链接:https://www.f2er.com/3160362.html

大家都在问