How can i enter multiple lines input in python. I have tried input() function but it doesn't work properly. I would like to enter input like this: 3\n 12\n 504\n 17 (first line shows number of lines)
Asked
Active
Viewed 39 times
-2
-
You can use multiple calls to `input`: each `input` will read one line β ForceBru Oct 12 '21 at 14:48
-
1Does this answer your question? [How do I read multiple lines of raw input in Python?](https://stackoverflow.com/questions/11664443/how-do-i-read-multiple-lines-of-raw-input-in-python) β Kyrela Oct 12 '21 at 15:19
1 Answers
0
You'd likely need to call the input() function multiple times to get the result you're wanting.
See this post for more information How to get multiline input from user

maak
- 11
- 3
-
As itβs currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). β Community Oct 12 '21 at 15:53