-2

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)

blej100
  • 1
  • 1
  • You can use multiple calls to `input`: each `input` will read one line – ForceBru Oct 12 '21 at 14:48
  • 1
    Does 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 Answers1

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