EADST

Python: Terminal Input to List

Transfer Terminal Input to List

 # give the group number
 # 2
 # group one
 # 1 3 2
 # group two
 # 1 2 1 3 2
inputs = []
count = int(input())
for i in range(count):
    s = input()
    line = []
    for x in s.split():
        line.append(int(x))
    inputs.append(line)
print(inputs) # [[1, 3, 2], [1, 2, 1, 3, 2]]

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文242篇,共被浏览296034

本站已经建立1791天!

热门文章
文章归档
回到顶部