簡體   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