I'm a beginner, and I'm training on CodeAbbey. They give you input, you can hardcode it but I'd rather like to use the input commands.
When it's a single line input it's pretty easy, I read it and store it in a list. This becomes tricky when they give multiple line inputs. At first I cheated a bit, I did copy/paste for each line one after the other. But sometimes there's 40 tests to do, so 40 copy/paste...and I'm lazy. So lazy I spent 2 hours searching how to get my multiple line input in a list.
It's a list of numbers, so basically this is what I do :
list1= [int(x) for x in input("your input").split()]
This works fine to store numbers in a list. But when I have multiple lines in my input, this gives me only the first line. I also tried :
list1= [int(x) for x in input("your input").split("\n")]
Or :
list1= [int(x) for x in input("your input").replace("\n", "")]
These change nothing, only got the first line of input.
I read that the simpler solution would be to store the input a text file and read it with my code, but I did not want to use external files right now as I'm starting to learn.
Thanks for your answers(and excuse my pretty bad english, not a native speaker).
EDIT : The exercise in question : http://www.codeabbey.com/index/task_view/min-of-three
I copy/paste the test data as my input as recommended, but only the first line is stored. I mean, if I print my list, only the first number is displayed, if I print the length of my list with len(), I get 0, which means I have 1 item in my list, right?