Python:打印列表序列

Python:打印列表序列,python,list,Python,List,是否可以用python编写干净的代码来打印以下内容: Introduce the number of lists you want to have: 3 Introduce how many numbers you want it to have: 3 Number: 1 Number: 2 Number: 3 [1,2,3] Introduce how many numbers you want it to have: 4 Number: 1 Number: 2 Number: 5 Numbe

是否可以用python编写干净的代码来打印以下内容:

Introduce the number of lists you want to have: 3
Introduce how many numbers you want it to have: 3
Number: 1
Number: 2
Number: 3
[1,2,3]
Introduce how many numbers you want it to have: 4
Number: 1
Number: 2
Number: 5
Number: 9
[1,2,5,9]
Introduce how many numbers you want it to have: 5
Number: 1
Number: 7
Number: 2
Number: 8
Number: 3
[1,7,2,8,3]
这是我的尝试,但它只适用于列表,因为我不知道如何添加多个列表:

v1=[]
n=input ("Introduce how many numbers you want it to have: ")
def introdTast():
      print("Introduce the numbers: ")
      for i in range(0,n):
      v1.append(input())

introdTast()
print "v1 =",v1
print "\n"
你的答案是:

然而,你要做的是:

lists = int(raw_input('Introduce the number of lists you want to have: '))
for i in xrange(lists):
    numbers = int(raw_input('Introduce how many numbers you want it to have: '))
    l = []
    for j in xrange(numbers):
        l.append(int(input('Number: ')))
    print l

是的,这是可能的。你的问题到底是什么?你如何编写代码?我试过几种方法。。但是我只会出错..那么,你应该发布你的代码和错误。