Python表 - 列表

时间:2015-03-01 14:10:43

标签: python list tabular

我在python中设计一个表,我对标题有点麻烦。这是我现在的代码:

x = ["4","5","6","7"]
y = ["1","2","3","4"]
z = ["0","1","2","3"]

def Printtable():

       for row in zip(x,y,z):
       print '      '.join(row)

userinput = int(input("Input:"))

    if userinput == 1:
    Printtable().

我希望输出如下:

Denary   Binary     Hex
0        0000       0
1        0001       1
2        0010       2

1 个答案:

答案 0 :(得分:0)

代码之前

print ' '.join('xyz')?很难说你想得到什么。