繁体   English   中英

如何在 python 中进行多行输入

[英]How to take multiple input in multiple line in python

我必须在多行中接受多个输入

例如

n=int(input())

我必须在 n 行中接受 n 个输入,每行接受多个输入

if n=5
then I have to take 5 input in 5  line
a=[1,2,3]
b=[1,2,3]
c=[1,2,3]
d=[1,2,3]
e=[1,2,3]

像这只是一个例子。

这将是你需要的......

n = int(input())
for i in range(n):
    exec(input())
print(a, b, c, d, e)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM