简体   繁体   English

在python中输入多行输入

[英]Entering multipleline input in python

How can i enter multiple lines input in python.如何在python中输入多行输入。 I have tried input() function but it doesn't work properly.我试过 input() 函数,但它不能正常工作。 I would like to enter input like this: 3\\n 12\\n 504\\n 17 (first line shows number of lines)我想输入这样的输入:3\\n 12\\n 504\\n 17(第一行显示行数)

You'd likely need to call the input() function multiple times to get the result you're wanting.您可能需要多次调用 input() 函数才能获得所需的结果。

See this post for more information How to get multiline input from user有关更多信息,请参阅此帖子如何从用户获取多行输入

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

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