如何在Python中读取输入中的多行?

2024-04-20 12:27:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在Python中输入多行代码。但是当我尝试打印结果时,它只打印第一行。有没有办法从输入中读取第一行以下的行

例如:

lista=input('Insert the data here: ')
print(' ')
print(lista)

假设我想输入:

你好,乔

汤姆

真的是在4

但它只打印第一行。 Console screenshot

你知道如何读取输入中的其他行以便以后打印吗


Tags: the代码inputdatahereinsertprint办法