I am trying to take an input formatted such as this (i.e values/items seperated by newlines) which is pasted into the terminal:
a
b
c
And have them all taken as an input and then appended to a list:
["a", "b", "c"]
While this seems like it should be very easy, I am having trouble figuring it out. If I try to paste the 3 items at once into the terminal only the first 1 is taken as the input. I end up with my list being just ["a"]and the others are ignored or taken as commands, which I do not want.
I did this:
ls = []
while len(ls) < 3:
items = input()
ls.append(items)
print(ls)
Which works if I have 3 items, however the number of items in my use case will be unkown, hence I cannot rely on this. Any help or critique, or a link to a previously answered question would be welcome.